Modern Computer Architecture and Organization
eBook - ePub

Modern Computer Architecture and Organization

Jim Ledin, Dave Farley

Condividi libro
  1. 666 pagine
  2. English
  3. ePUB (disponibile sull'app)
  4. Disponibile su iOS e Android
eBook - ePub

Modern Computer Architecture and Organization

Jim Ledin, Dave Farley

Dettagli del libro
Anteprima del libro
Indice dei contenuti
Citazioni

Informazioni sul libro

A no-nonsense, practical guide to current and future processor and computer architectures that enables you to design computer systems and develop better software applications across a variety of domainsKey Features• Understand digital circuitry through the study of transistors, logic gates, and sequential logic• Learn the architecture of x86, x64, ARM, and RISC-V processors, iPhones, and high-performance gaming PCs• Study the design principles underlying the domains of cybersecurity, bitcoin, and self-driving carsBook DescriptionAre you a software developer, systems designer, or computer architecture student looking for a methodical introduction to digital device architectures, but are overwhelmed by the complexity of modern systems? This step-by-step guide will teach you how modern computer systems work with the help of practical examples and exercises. You'll gain insights into the internal behavior of processors down to the circuit level and will understand how the hardware executes code developed in high-level languages.This book will teach you the fundamentals of computer systems including transistors, logic gates, sequential logic, and instruction pipelines. You will learn details of modern processor architectures and instruction sets including x86, x64, ARM, and RISC-V. You will see how to implement a RISC-V processor in a low-cost FPGA board and write a quantum computing program and run it on an actual quantum computer.This edition has been updated to cover the architecture and design principles underlying the important domains of cybersecurity, blockchain and bitcoin mining, and self-driving vehicles.By the end of this book, you will have a thorough understanding of modern processors and computer architecture and the future directions these technologies are likely to take.What you will learn• Understand the fundamentals of transistor technology and digital circuits• Explore the concepts underlying pipelining and superscalar processing• Implement a complete RISC-V processor in a low-cost FPGA• Understand the technology used to implement virtual machines• Learn about security-critical computing applications like financial transaction processing• Get up to speed with blockchain and the hardware architectures used in bitcoin mining• Explore the capabilities of self-navigating vehicle computing architectures• Write a quantum computing program and run it on a real quantum computerWho this book is forThis book is for software developers, computer engineering students, system designers, reverse engineers, and anyone looking to understand the architecture and design principles underlying modern computer systems: ranging from tiny, embedded devices to warehouse-size cloud server farms. A general understanding of computer processors is helpful but not required.

Domande frequenti

Come faccio ad annullare l'abbonamento?
È semplicissimo: basta accedere alla sezione Account nelle Impostazioni e cliccare su "Annulla abbonamento". Dopo la cancellazione, l'abbonamento rimarrà attivo per il periodo rimanente già pagato. Per maggiori informazioni, clicca qui
È possibile scaricare libri? Se sì, come?
Al momento è possibile scaricare tramite l'app tutti i nostri libri ePub mobile-friendly. Anche la maggior parte dei nostri PDF è scaricabile e stiamo lavorando per rendere disponibile quanto prima il download di tutti gli altri file. Per maggiori informazioni, clicca qui
Che differenza c'è tra i piani?
Entrambi i piani ti danno accesso illimitato alla libreria e a tutte le funzionalità di Perlego. Le uniche differenze sono il prezzo e il periodo di abbonamento: con il piano annuale risparmierai circa il 30% rispetto a 12 rate con quello mensile.
Cos'è Perlego?
Perlego è un servizio di abbonamento a testi accademici, che ti permette di accedere a un'intera libreria online a un prezzo inferiore rispetto a quello che pagheresti per acquistare un singolo libro al mese. Con oltre 1 milione di testi suddivisi in più di 1.000 categorie, troverai sicuramente ciò che fa per te! Per maggiori informazioni, clicca qui.
Perlego supporta la sintesi vocale?
Cerca l'icona Sintesi vocale nel prossimo libro che leggerai per verificare se è possibile riprodurre l'audio. Questo strumento permette di leggere il testo a voce alta, evidenziandolo man mano che la lettura procede. Puoi aumentare o diminuire la velocità della sintesi vocale, oppure sospendere la riproduzione. Per maggiori informazioni, clicca qui.
Modern Computer Architecture and Organization è disponibile online in formato PDF/ePub?
Sì, puoi accedere a Modern Computer Architecture and Organization di Jim Ledin, Dave Farley in formato PDF e/o ePub, così come ad altri libri molto apprezzati nelle sezioni relative a Informatica e Hardware. Scopri oltre 1 milione di libri disponibili nel nostro catalogo.

Informazioni

Anno
2022
ISBN
9781803238234
Edizione
2
Argomento
Informatica
Categoria
Hardware

Appendix

Answers to Exercises

Chapter 1: Introducing Computer Architecture

Exercise 1

Using your favorite programming language, develop a simulation of a single-digit decimal adder that operates in the same manner as in Babbage’s Analytical Engine. First, prompt the user for two digits in the range 0-9: the addend and the accumulator. Display the addend, the accumulator, and the carry, which is initially zero. Perform a series of cycles as follows:
  1. If the addend is zero, display the values of the addend, accumulator, and carry and terminate the program
  2. Decrement the addend by one and increment the accumulator by one
  3. If the accumulator incremented from nine to zero, increment the carry
  4. Go back to step 1
Test your code with these sums: 0+0, 0+1, 1+0, 1+2, 5+5, 9+1, and 9+9.

Answer

The Ex__1_single_digit_adder.py Python file contains the adder code:
#!/usr/bin/env python """Ex__1_single_digit_adder.py: Answer to Ch 1 Ex 1.""" import sys # Perform one step of the Analytical Engine addition # operation. a and b are the digits being added, c is the # carry def increment_adder(a, b, c): a = a - 1 # Decrement addend b = (b + 1) % 10 # Increment accum, wrap to 0 if necessary if b == 0: # If accumulator is 0, increment carry c = c + 1 return a, b, c # Add two decimal digits passed on the command line. # The sum is returned as digit2 and the carry is 0 or 1. def add_digits(digit1, digit2): carry = 0 while digit1 > 0: [digit1, digit2, carry] = increment_adder( digit1, digit2, carry) return digit2, carry 
The Ex__1_test_single_digit_adder.py file contains the test code:
#!/usr/bin/env python """Ex__1_test_single_digit_adder.py: Tests for answer to  chapter 1 exercise 1.""" import unittest import Ex__1_single_digit_adder class TestSingleDigitAdder(unittest.TestCase): def test_1(self): self.assertEqual(Ex__1_single_digit_adder.add_digits( 0, 0), (0, 0)) def test_2(self): self.assertEqual(Ex__1_single_digit_adder.add_digits( 0, 1), (1, 0)) def test_3(self): self.assertEqual(Ex__1_single_digit_adder.add_digits( 1, 0), (1, 0)) def test_4(self): self.assertEqual(Ex__1_single_digit_adder.add_digits( 1, 2), (3, 0)) def test_5(self): self.assertEqual(Ex__1_single_digit_adder.add_digits( 5, 5), (0, 1)) def test_6(self): self.assertEqual(Ex__1_single_digit_adder.add_digits( 9, 1), (0, 1)) def test_7(self): self.assertEqual(Ex__1_single_digit_adder.add_digits( 9, 9), (8, 1)) if __name__ == '__main__': unittest.main() 
To execute the tests, assuming Python is installed and is in your path, execute the following command:
python Ex__1_test_single_digit_adder.py This is the output of a test run: C:\>python Ex__1_test_single_digit_adder.py ....... ---------------------------------------------------------------------- Ran 7 tests in 0.001s OK 

Exercise 2

Create arrays of 40 decimal digits each for the addend, accumulator, and carry. Prompt the user for two decimal integers of up to 40 digits each. Perform the addition digit by digit using the cycles described in Exercise 1, and collect the carry output from each digit position in the carry array. After the cycles are complete, insert carries and, where necessary, ripple them across digits to complete the addition operation. Display the results after each cycle and at the end. Test with the same sums as in Exercise 1 and test 99+1, 999999+1, 49+50, and 50+50.

Answer

The Ex__2_40_digit_adder.py Python file contains the adder code:
#!/usr/bin/env python """Ex__2_40_digit_adder.py: Answer to Ch 1 Ex 2.""" import sys import Ex__1_single_digit_adder # Add two decimal numbers of up to 40 digits and return the # sum. Input and output numeric values are represented as # strings. def add_40_digits(str1, str2): max_digits = 40 # Convert str1 into a 40 decimal digit value num1 = [0]*max_digits for i, c in enumerate(reversed(str1)): num1[i] = int(c) - int('0') # Convert str2 into a 40 decimal digit value num2 = [0]*max_digits for i, c in enumerate(reversed(str2)): num2[i] = int(c) - int('0') # Sum the digits at each position and record the # carry for each position sum = [0]*max_digits carry = [0]*max_digits for i in range(max_digits): (sum[i], carry[i]) = Ex__1_single_digit_adder. \ add_digits(num1[i], num2[i]) # Ripple the carry values across the digits for i in range(max_digits-1): if (carry[i] == 1): sum[i+1] = (sum[i+1] + 1) % 10 if (sum[i+1] == 0): carry[i+1] = 1 # Convert the result into a string with leading zeros # removed sum.reverse() sum_str = "".join(map(str, sum)) sum_str = sum_str.lstrip('0') or '0' return sum_str 
The Ex__2_test_40_digit_adder.py file contains the test code:
#!/usr/bin/env python """Ex__2_test_40_digit_adder.py: Tests for answer to  chapter 1 exercise 2.""" import unittest import Ex__2_40_digit_adder class Test40DigitAdder(unittest.TestCase): def test_1(self): self.ass...

Indice dei contenuti