

















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A comprehensive overview of computer architecture, covering key concepts such as memory types, machine language instructions, communication between devices, and bitwise operations. It delves into the functionality of registers, main memory, mass storage, and cache memory, explaining their roles in data storage and retrieval. The document also explores the fetch-decode-execute cycle, program counter, and the distinction between programs and data. It further examines logic operations, shift operations, and their applications in computer programming. The document concludes with a discussion of social issues related to computer architecture, including ownership, planned obsolescence, and the impact of technology on society.
Typology: Schemes and Mind Maps
1 / 25
This page cannot be seen from the preview
Don't miss anything!


















| GHz | One billion Hz | However, clock speed alone is not a reliable measure of a computer's power > "Benchmarking is a more meaningful way to compare the performance of dif Program execution involves the CPU fetching instructions from memory, deco
The fetch-decode-execute cycle is the process by which the CPU executes in
The program counter is a register that keeps track of the current instruct
Programs and data are stored in memory, but the CPU has no way of knowing
Having programs and data share the same memory space has several advantage
Logic operations are used to combine two input bits to produce a single ou
The AND operation combines two input bits to produce a single output bit.
The OR operation combines two input bits to produce a single output bit. I
The XOR operation combines two input bits to produce a single output bit.
Rotation and shift operations provide a means for moving bits within a reg
There are several types of shift operations:
Shift operations have several uses:
The machine language described in Appendix C uses opcodes 7, 8, and 9 for
OpcodeOperationDescription 7ORPerforms the OR operation between the contents of two designate 8ANDPerforms the AND operation between the contents of two designa 9XORPerforms the XOR operation between the contents of two designaSTORE A3, 5 LOAD A3, 5
### Standard Signals Devices connected to a controller convert their internal signals to a stan ### USB and FireWire * **USB (Universal Serial Bus)**: a standard interface **for** connecting devi * **FireWire**: a high-speed interface **for** connecting devices to a compute | | USB | FireWire | | --- | --- | --- | | Transfer Rate | Up to 480 Mbps (USB 2.0) | Up to 800 Mbps (FireWire 800 ) | Distance | Up to 3 meters | Up to 4.5 meters | | Devices | Mice, keyboards, printers, scanners, digital cameras, smartpho ### Handshaking The transfer of data between two computer components **is** a two-way process, > "Handshaking is a process that allows devices to communicate with each o ### Status Word A status word is a bit pattern generated by a peripheral device and sent t ### Communication Media Communication between devices can occur over two types of paths: parallel * **Parallel Communication**: multiple signals are transferred at the same * **Serial Communication**: signals are transferred one after the other ov | | Parallel Communication | Serial Communication | | --- | --- | --- | | Speed | Faster | Slower | | Complexity | More complex | Less complex | | Examples | Computer internal bus, USB, FireWire | Ethernet connections, ### Communication Rates The rate at which bits are transferred **from** one device to another **is** measu * **bps (bits per second)**: the rate at which bits are transferred * **Kbps (kilobits per second)**: 1 , 000 bps * **Mbps (megabits per second)**: 1 , 000 , 000 bps * **Gbps (gigabits per second)**: 1 , 000 , 000 , 000 bps ### Programming Data Manipulation High-level programming languages, such **as** Python, shield users **from** the de #### Logic and Shift Operations Logic **and** shift operations can be executed on numerical data. ```python x = 0b mask = 0b print(0b00000101 ^ 0b00000100) # Prints 5 XOR 4, which is 1 print(0b00000101 | 0b00000100) # Prints 5 OR 4, which is 5 print(0b00000101 & 0b00000100) # Prints 5 AND 4, which is 4 ```## Bitwise Operations Bitwise operations are used to manipulate the individual bits of a binary ### Bitwise AND (&) The bitwise AND operation compares each bit of the first operand to the co ```python print(0b10011010 & 0b11001001) # Output: 10001000 Bitwise OR (|) ## The bitwise OR operation compares each bit of the rst operand to the corresponding ## bit of the second operand. If either bit is 1, the corresponding result bit is set to 1. ## Otherwise, the corresponding result bit is set to 0. print(0b10011010 | 0b11001001) # Output: 11011011 Bitwise XOR (^) ## The bitwise XOR operation compares each bit of the rst operand to the ## corresponding bit of the second operand. If the bits are not the same, the ## corresponding result bit is set to 1. Otherwise, the corresponding result bit is set to 0. print(0b10011010 ^ 0b11001001) # Output: 01010011 ## Conditional statements are used to execute a block of code if a certain condition is ## true. **if** water_temp > 140 : print('Bath water too hot!') ## Loops ## Loops are used to execute a block of code repeatedly. n = 0 **while** n < 10 : print(n) n = n + 1 ## Functions ## Functions are blocks of code that can be called multiple times from different parts of ## a program. ## Built-in Functions ## Python has several built-in functions that can be used to perform various tasks. ## print(): prints the output to the screen ## bin(): converts an integer to its binary representation ## int(): converts a string to an integer ## User-de ned Functions ## Users can de ne their own functions to perform speci c tasks. ## Function Calls ## Function calls are used to invoke a function and execute its code. x = 1034 y = 1056 z = 2078 biggest = max(x, y, z) print(biggest) # Output: 2078 ## Input and Output ## Input and output are used to interact with the user and display the results of a ## program. ## Input ## The input() function is used to get input from the user. echo = input('Please enter a string to echo: ') print(echo * 3 ) ## Output ## The print() function is used to display the output to the screen. print('Hello, World!') ## Error Handling ## Error handling is used to handle errors that may occur during the execution of a ## program. ## Type Errors ## A function is a block of code that can be called multiple times from different ## parts of a program. ## Functions can take arguments, which are values passed to the function when it ## is called. ## Functions can return values, which are values passed back to the caller when ## the function nishes executing. ## A function is like a recipe. You put in the ingredients (arguments), follow ## the instructions (the function body), and get out a result (the return value). User-De ned Functions ## User-de ned functions are functions that are de ned by the programmer, as ## opposed to built-in functions like input() and int(). ## User-de ned functions are de ned using the def keyword, followed by the ## name of the function and a list of arguments in parentheses. ## The body of the function is indented under the function de nition. Example: Hypotenuse Calculator **import** math sideA = int(input('Length of side A? ')) sideB = int(input('Length of side B? ')) hypotenuse = math.sqrt(sideA** 2 + sideB** 2 ) print(hypotenuse) Example: Marathon Training Assistant **import** math **def total_seconds** (min, sec): **return** min * 60 + sec **def speed** (time): **return** 3600 / time pace_minutes = int(input('Minutes per mile? ')) pace_seconds = int(input('Seconds per mile? ')) miles = int(input('Total miles? ')) mph = speed(total_seconds(pace_minutes, pace_seconds)) print('Your speed is') print(mph) total = miles * total_seconds(pace_minutes, pace_seconds) elapsed_minutes = total // 60 elapsed_seconds = total % 60 print('Your total elapsed time is') print(elapsed_minutes) print(elapsed_seconds) Pipelining ## Pipelining is a technique used to improve the throughput of a computer by ## allowing the steps in the machine cycle to overlap. ## Pipelining can increase the number of instructions that can be executed per ## second, even if the execution speed of individual instructions remains the same. Multi-Core CPUs ## A multi-core CPU is a CPU that contains multiple processing units on a single ## chip. ## Multi-core CPUs can execute multiple instructions simultaneously, improving ## the overall performance of the computer. Multiprocessor Machines ## Example: Pipelining Con ict ## Suppose two processors are attached to the same memory and executing different ## programs. One processor needs to add one to the contents of a memory cell, while ## the other needs to subtract one from the same cell. If the processors execute their ## instructions concurrently, the result may be incorrect. ## Resolving Con icts ## To resolve con icts, the system must ensure that the instructions are executed in a ## way that maintains the correct result. This can be done by: ## Using locks or semaphores to synchronize access to shared memory locations ## Implementing a cache coherence protocol to ensure that each processor has a ## consistent view of the memory ## Machine Language and Instruction Execution ## Machine language is the binary code that a computer's processor understands. It ## consists of a series of instructions, each of which speci es an operation to be ## performed by the processor. ## Instruction Format ## An instruction typically consists of an opcode (operation code) and an operand (data). ## The opcode speci es the operation to be performed, while the operand speci es the ## data to be used in the operation. ## Example: Instruction Format ### Opcode Operand ## LOAD 77 ## STORE 42 ## Instruction Execution ## When an instruction is executed, the processor performs the following steps: ## 1. Fetch the instruction from memory ## 2. Decode the instruction (determine the operation and operand) ## 3. Execute the instruction (perform the operation) ## 4. Store the result (if applicable) ## Program Counter and Instruction Register ## The program counter (PC) is a register that stores the address of the next instruction ## to be executed. The instruction register (IR) is a register that stores the current ## instruction being executed. ## Example: Program Counter and Instruction Register ### PC IR ## 00 LOAD 77 ## 01 STORE 42 ## Memory Organization ## Memory is organized into a series of cells, each of which can store a binary value. The ## cells are addressed using a unique address. ## Example: Memory Organization ### Address Contents ## Floating-Point Representation ## Floating-point numbers are represented using a binary format that consists of a sign ## bit, exponent, and mantissa.