Computer Organization and Design Test 1 Study Guide PDF
Document Details
Uploaded by CharismaticCongas1611
University of North Florida
Tags
Related
- Computer Organization and Architecture PDF
- (The Morgan Kaufmann Series in Computer Architecture and Design) David A. Patterson, John L. Hennessy - Computer Organization and Design RISC-V Edition_ The Hardware Software Interface-Morgan Kaufmann-24-101-9-11.pdf
- Computer Organization and Design RISC-V Edition PDF
- (The Morgan Kaufmann Series in Computer Architecture and Design) David A. Patterson, John L. Hennessy - Computer Organization and Design RISC-V Edition_ The Hardware Software Interface-Morgan Kaufmann-102-258.pdf
- (The Morgan Kaufmann Series in Computer Architecture and Design) David A. Patterson, John L. Hennessy - Computer Organization and Design RISC-V Edition_ The Hardware Software Interface-Morgan Kaufmann-102-258-pages-4.pdf
- (The Morgan Kaufmann Series in Computer Architecture and Design) David A. Patterson, John L. Hennessy - Computer Organization and Design RISC-V Edition_ The Hardware Software Interface-Morgan Kaufmann-102-258-pages-5.pdf
Summary
This document is a study guide for a computer organization and design test. It covers topics such as computer technology, hardware, software, and introduces concepts like Moore's Law, pipelining, and parallelism. The study guide includes illustrative examples as well as details about computer components and memory layout.
Full Transcript
COMPUTER ORGANIZATION AND DESIGN 6th Edition The Hardware/Software Interface Test 1 Study Guide Computer Technology Computer Hardware Computer Software MODULE 1 MATERIAL Chapter 1 — Computer Abstractions and Technology — 2 ...
COMPUTER ORGANIZATION AND DESIGN 6th Edition The Hardware/Software Interface Test 1 Study Guide Computer Technology Computer Hardware Computer Software MODULE 1 MATERIAL Chapter 1 — Computer Abstractions and Technology — 2 §1.2 Seven Great Ideas in Computer Architecture Eight Great Ideas Design for Moore’s Law Gordon Moore (Intel Corporation) 1965 observation of Integrated Circuit improvement Approximately every 18-24 months a doubling occurs in Transistor count Clock speed Chapter 1 — Computer Abstractions and Technology — 3 §1.2 Seven Great Ideas in Computer Architecture Eight Great Ideas Design for Moore’s Law Prior to the early 2000s Hardware was bottleneck in most computer systems Mid-2000s Hardware reached physical limitations of silicon Power and heat issues Electron drift Introduction of multi-core processors Quantum computing Chapter 1 — Computer Abstractions and Technology — 4 Response Time and Throughput Response time How long it takes to complete a task Throughput Total work complete per a given time unit Bytes per second Customers server per hour How are response time and throughput affected by Replacing a processor with a faster model? Response time decreases Takes less time to complete a task Throughput increases More work completed during a given time unit Including additional (similar) processors? Response time remains the same Throughput increases Chapter 1 — Computer Abstractions and Technology — 5 Measuring Execution Time Elapsed time Total response time, including all aspects Processing, I/O, OS overhead, other jobs, idle time Used to measure system performance CPU time Time spent processing a given job Discounts I/O, other jobs, idle time Programs perform differently CPU vs I/O intensive OS overhead/performance Other running jobs Chapter 1 — Computer Abstractions and Technology — 6 §1.2 Seven Great Ideas in Computer Architecture Eight Great Ideas Performance via pipelining Multiple instructions execute simultaneously Sort of Consider an inefficient laundry system (times in minutes) Each load of laundry has 3 stages: wash, dry & fold All 3 stages performed for a single load Wash Stage: 30 Dry Stage: 40 Fold Stage: 20 Total Time: 90 Elapsed Time: 360 Chapter 1 — Computer Abstractions and Technology — 7 §1.2 Seven Great Ideas in Computer Architecture Eight Great Ideas Performance via pipelining Consider a more efficient laundry system (times in minutes) Each load of laundry has 3 stages: wash, dry & fold When a load of laundry completes a stage, the next load starts that stage Wash Stage: 30 Dry Stage: 40 Fold Stage: 20 Total Time: 90 Elapsed Time: 200 Chapter 1 — Computer Abstractions and Technology — 8 §1.2 Seven Great Ideas in Computer Architecture Eight Great Ideas Pipelining in a microprocessor Precursor to parallel processing Each instruction has a set of stages (at least 4) Instruction Fetch Instruction Decode Instruction Execute Write Back By performing instructions on a per-stage basis Complete more instructions in less time (increase throughput) Chapter 1 — Computer Abstractions and Technology — 9 §1.2 Seven Great Ideas in Computer Architecture Eight Great Ideas Performance via parallelism Multiple instructions execute simultaneously Grocery store checkout example Single checkout line can result in long wait times Chapter 1 — Computer Abstractions and Technology — 10 §1.2 Seven Great Ideas in Computer Architecture Eight Great Ideas Performance via parallelism Parallel checkout lines Process more customers in the same amount of time Reduces wait times Smaller purchases are not delayed by larger purchases Chapter 1 — Computer Abstractions and Technology — 11 §1.2 Seven Great Ideas in Computer Architecture Eight Great Ideas Performance via parallelism Multiple instructions execute simultaneously Multiple processors or cores Execute multiple instructions simultaneously One instruction per processor or core Shorter programs are not delayed by larger programs Response time is not affected Throughput increases Chapter 1 — Computer Abstractions and Technology — 12 §1.2 Seven Great Ideas in Computer Architecture Eight Great Ideas Designing for parallelism can be difficult These statements cannot be performed in parallel int a = 2 * b; int c = a + 4; These statements can be performed in parallel int a = 2 * b; int c = b + 4; The compiler to identify instructions to perform in parallel The programmer to design a program for parallel execution Create “workers” to perform a discrete task simultaneously Chapter 1 — Computer Abstractions and Technology — 13 §1.2 Seven Great Ideas in Computer Architecture Eight Great Ideas Dependability via redundancy Most computer hardware is dependable (no moving parts) Microprocessor Memory Hard drives are not as dependable Especially traditional (non-SSD) drives Nearly all the user’s data is stored on the hard drive A hard drive failure can be costly in time, money, and aggravation Redundant Array of Inexpensive Disks (RAID) Offers solutions to avoid data loss in the event of a hard drive failure Chapter 1 — Computer Abstractions and Technology — 14 §1.2 Seven Great Ideas in Computer Architecture Eight Great Ideas Dependability via redundancy RAID 0 (2 or more drives) Combines multiple hard drives together Creates illusion of a single, large hard drive Does not prevent data loss RAID 1 (2 drives) Maintains an exact copy of the data on 2 hard drives Often referred to as “mirroring” Capable of surviving a single drive failure Chapter 1 — Computer Abstractions and Technology — 15 §1.2 Seven Great Ideas in Computer Architecture Eight Great Ideas Dependability via redundancy RAID 5 (3 or more drives) Calculates parity of 2 pieces of data C=A+B Stores the parity data along with the 2 pieces of data Separate hard drives If a single piece of data is lost, system can reconstruct the data A=C-B B=C-A C=A+B Capable of surviving a single drive failure Chapter 1 — Computer Abstractions and Technology — 16 §1.2 Seven Great Ideas in Computer Architecture Eight Great Ideas Dependability via redundancy RAID 6 (4 or more drives) Like RAID 5, but calculates a second parity value If any 2 pieces of data are lost, system can reconstruct the data Capable of surviving up to 2 drive failures Chapter 1 — Computer Abstractions and Technology — 17 MODULE 2 MATERIAL Chapter 1 — Computer Abstractions and Technology — 18 §1.4 Under the Covers Components of a Computer The BIG Picture Same components for all kinds of computer Desktop, server, embedded Input/output includes User-interface devices Display, keyboard, mouse Storage devices Hard disk, CD/DVD, flash Network adapters For communicating with other computers Chapter 1 — Computer Abstractions and Technology — 19 Inside the Processor (CPU) Control Unit Controls the datapath, memory, etc. Datapath Performs operations on data Arithmetic Logic Unit (ALU) Performs math and logic operations Math: add, subtract, multiply, division, modulus Logic: and, or, xor, and not Floating-Point Unit (FPU) Performs floating-point math operations Chapter 1 — Computer Abstractions and Technology — 20 Inside the Processor (CPU) Datapath Floating-Point Unit (FPU) Performs floating-point math operations Think values in scientific notation 2 Ex. 491.25 stored as 4.9125 x 10 Registers Small amount of memory (32 or 64 bits) Temporarily store value(s) between operations Ex. Storing the result of the operation 2 + 4 Modern CPUs provide registers for Integer values Floating-point values System management values Chapter 1 — Computer Abstractions and Technology — 21 Inside Memory Modern memory Static Random-Access Memory (SRAM) Dynamic Random-Access Memory (DRAM) Volatile memory – data can be lost Non-volatile memory – data retained ROM (non-volatile) ROM permanently stores programs and data A computer’s BIOS is a good example ROM has mostly been replaced by firmware Chapter 1 — Computer Abstractions and Technology — 22 Inside Memory DRAM Diagram 1 bit composed of 1 transistor 1 capacitor Address lines Select row of bits Up to 64 lines (64 bit) Data lines Read/write bits 64 lines (64 bit) Requires refreshes Chapter 1 — Computer Abstractions and Technology — 23 Inside Memory SRAM Diagram (cache memory) 1 bit composed of 6 transistors >6 transistors possible Stores both 0 and 1 Compensates for noise Ensures high-quality bit Chapter 1 — Computer Abstractions and Technology — 24 Inside Input Devices Mouse 3 general types Mechanical mouse Optical mouse Trackball Chapter 1 — Computer Abstractions and Technology — 25 Inside Input Devices Mouse Invented by Douglas Engelbart in 1963 Demonstrated the mouse in 1968 Known as the Mother of All Demos Mechanical mouse operation Ball rotates 2 slotted disks Disks translate movement along x and y planes Direction Velocity Optical sensors detect Direction of rotation Velocity of rotation Chapter 1 — Computer Abstractions and Technology — 26 Inside Input Devices Mouse Optical mouse operation LED light is reflected off the surface into a camera Camera records pictures of the surface Controller compares pictures for changes Changes between the pictures used to calculate Direction of movement Velocity of movement Chapter 1 — Computer Abstractions and Technology — 27 Hard Drive Hard drive components Platter Data stored on both sides Spindle Spins the platters Constant speed Arm Positions heads over platters Read/write heads 2 sets of heads per platter 1 set per side Chapter 1 — Computer Abstractions and Technology — 28 Hard Drive Hard drive data structures Track (A) Concentric circle Data is stored along a track Cylinder (A across multiple platters) Combines a single track across platters Think of a soup can Sector (B) Pie-shaped section of a platter Geometrically divides tracks into blocks Block (C) Smallest grouping of data Physical size determined by track position within sector Same amount of data (i.e., 512 bytes) stored in each block Density of the data within a block depends on the track position File (D) 1 or more blocks needed to store the data of a file Chapter 1 — Computer Abstractions and Technology — 29 Networks 4 basic topologies (network layouts) Bus (not used for modern networking) Simple Limited size and bandwidth due to Signal to noise limits Collisions Ring (not used for modern networking) Similar to bus topology Only 1 computer can transmit data at a time Limited size, but better bandwidth No collisions Chapter 1 — Computer Abstractions and Technology — 30 Networks 4 basic topologies (network layouts) Star Common in modern LAN networks Similar to bus topology None of the limitations except length Mesh Common in modern WAN networks Multiple connections between networked devices Provides high-level of fault tolerance Device failure Wiring failure Chapter 1 — Computer Abstractions and Technology — 31 MODULE 3 MATERIAL Chapter 1 — Computer Abstractions and Technology — 32 Levels of Program Code High-level language Level of abstraction away from hardware Allows programmer to focus on problem domain Provides for productivity and portability Little knowledge of the machine required Assembly language Textual representation of instructions Uses mnemonic symbols Machine dependent Normally produced by a compiler Hardware representation Encoded instructions and data Encoded in binary digits (bits) Stored in different locations of program Only form executed by machine Chapter 1 — Computer Abstractions and Technology — 33 Creating Executable Program Program Written in some high-level language (C/Java) Most are considered machine independent May contain some assembly instructions Very rare (C and C++ are most common) #include int main(int argc, char *argv[]) { int sum = 0; for(int x = 0; x < 100; x++) sum += x; printf(“The sum from 0.. 100 is %d\n”, sum); } Chapter 1 — Computer Abstractions and Technology — 34 Creating Executable Program Compiler Translates HLL code into assembly language Textual (mnemonic) representation of machine language Machine dependent Ignores assembly code in program Assembly code passed to assembler Header files passed to linker Assembled versions of header files Example: #include Chapter 1 — Computer Abstractions and Technology — 35 Creating Executable Program Assembler Converts assembly language into machine language The assembled file is often referred to as object code Contains only binary digits Assembled code is not executable yet Missing object code for header files Chapter 1 — Computer Abstractions and Technology — 36 Creating Executable Program Linker Combines several object code files together C program object code Header object code The stdio.o file is the assembled version of the stdio.h header file Other C program files (i.e., program-specific libraries) The output of the linker is executable by the CPU Chapter 1 — Computer Abstractions and Technology — 37 Assembler Directives In MIPS, assembler directives start with a. List of common assembler directives .align [n] Read 2n number of bytes from memory Common values of n are 0 (1 byte) and 2 (4 bytes) .ascii [str] &.asciiz [str] Store a string (str) of data directly in the program ascii creates a string (not null-terminated) asciiz creates a null-terminated string Chapter 1 — Computer Abstractions and Technology — 38 Assembler Directives In MIPS, assembler directives start with a. List of common assembly directives .data Defines the data segment of the program Contains the data used by the program .globl [label] Defines a label that can be referenced by an external program Most commonly the OS Most common global label is “main” .text Defines the instruction segment of the program Contains only instructions (no data) Instructions can reference data Chapter 1 — Computer Abstractions and Technology — 39 Working with Binary Numbers Humans understand decimal values Decimal number system (base 10) Valid digits (0, 1, 2, 3, 4, 5, 6, 7, 8, 9) Digits represent a value based on their position Positional values (104 103 102 101 100) 123 = 1 x 102 + 2 x 101 + 3 x 100 = 100 + 20 + 3 = 123 Chapter 1 — Computer Abstractions and Technology — 40 Working with Binary Numbers Computers understand binary values 0 – off state 1 – on state Binary number system (base 2) Valid digits (0, 1) Digits represent a value based on their position Positional values (27 26 25 24 23 22 21 20) 10102 = 1 x 23 + 0 x 22 + 1 x 21 + 0 x 20 = 8 + 0 + 2 + 0 = 1010 Chapter 1 — Computer Abstractions and Technology — 41 Working with Binary Numbers Converting from decimal to binary Use the positional values (27 26 25 24 23 22 21 20) Start with the largest positional value Convert 21910 to binary (answer is 110110112) 27 = 128 219 >= 128 27 is a 1 219 – 128 = 91 26 = 64 91 >= 64 26 is a 1 91 – 64 = 27 25 = 32 27 < 32 25 is a 0 27 – 0 = 27 24 = 16 27 >= 16 24 is a 1 27 – 16 = 11 23 = 8 11 >= 8 23 is a 1 11 – 8 = 3 22 = 4 3= 2 21 is a 1 3–2=1 20 = 1 1 >= 1 20 is a 1 1–1=0 Reaching 0 is the goal If 0 is reached before position 20, all positions to the right are 0’s Chapter 1 — Computer Abstractions and Technology — 42 Working with Binary Numbers Converting from binary to decimal Use the positional values (27 26 25 24 23 22 21 20) Multiply each positional value by either 1 or 0 Sum the results Convert 110110112 to decimal (answer is 21910) 27 = 128 27 is a 1 128 x 1 = 128 26 = 64 26 is a 1 64 x 1 = 64 25 = 32 25 is a 0 32 x 0 = 0 24 = 16 24 is a 1 16 x 1 = 16 23 = 8 23 is a 1 8x1=8 22 = 4 22 is a 0 4x0=0 21 = 2 21 is a 1 2x1=2 20 = 1 20 is a 1 1x1=1 128 + 64 + 0 + 16 + 8 + 0 + 2 + 1 = 21910 Chapter 1 — Computer Abstractions and Technology — 43 Working with Binary Numbers Pop quiz Convert these decimal numbers to binary 1510 000011112 3210 001000002 7310 010010012 10010 011001002 25510 111111112 Convert these binary numbers to decimal 000000002 010 000000102 210 000011112 1510 010000002 6410 101010102 17010 Chapter 1 — Computer Abstractions and Technology — 44 Working with Hex Numbers Humans use hexadecimal rather than binary 1 hexadecimal digit represents 4 binary digits Hexadecimal number system (base 16) Valid digits (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F) A = 10, B = 11, C = 12, D = 13, E = 14, F = 15 Positional values (163 162 161 160) A5F16 = A x 162 + 5 x 161 + F x 160 = 2560 + 80 + 15 = 265510 Hexadecimal can be written like 0xA5F or 0xa5f Chapter 1 — Computer Abstractions and Technology — 45 Working with Hex Numbers Converting from decimal to hexadecimal First, convert decimal number to binary Next, convert binary to hexadecimal Break binary digits into groups of 4 digits each Always start from right side of the binary number Convert each group of binary digits into a single hex digit 0 to F Combine the hex digits together Convert 1210 to hexadecimal (answer 0C16) 1210 = 000010102 = 016 + D16 = 0D16 Chapter 1 — Computer Abstractions and Technology — 46 Working with Hex Numbers Converting from hexadecimal to decimal First, convert from hexadecimal to binary Convert each hex digit into group of 4 binary digits Combine the groups of binary digits together Next, convert binary to decimal Convert ACE16 to decimal (answer 2,76610) ACE16 = 10102 + 11002 + 11102 = 1010110011102 = 2,76610 Chapter 1 — Computer Abstractions and Technology — 47 Working with Hex Numbers Pop quiz Convert these decimal numbers to hex 1510 F16 3210 0x20 7310 4916 10010 0x64 25510 0xff Convert these binary numbers to hex 000000002 0x00 000000102 216 000011112 0x0f 010000002 4016 101010102 0xAA Chapter 1 — Computer Abstractions and Technology — 48 System Memory Layout System memory organized into sections Reserved Operating system kernel OS-related programs Text Instructions of a program Shared by multiple programs Includes linked programs Example: stdio.o Constant values stored here Example: #define PI 3.14 Chapter 1 — Computer Abstractions and Technology — 49 System Memory Layout System memory organized into sections Data Stores some of a program’s data Static data Global variables Not dynamic variables Pointers, structures, objects Dynamic data (referred to as a heap) Dynamic variables (Pointers, structures, objects) The heap can expand and contract as needed OS’s garbage collection manages unused allocated space Constant values stored in the text segment Chapter 1 — Computer Abstractions and Technology — 50 System Memory Layout System memory organized into sections Stack Stores remainder of program data Function parameters (arguments) Registers can also be used Local variables Even in the main function Command-line arguments The stack can expand and contract as needed Expands when a function is called Multiple function calls can cause a stack overflow Contracts after a function returns Local variables are destroyed Chapter 1 — Computer Abstractions and Technology — 51 System Memory Layout Loading a program into memory #include #define PI 3.14 int radius; // Global variable (static data) int *radius; // Global pointer (dynamic data) int main() { double circumference; // Local variable printf(“Enter the radius of a circle: “); scanf(“%d”, &radius); circumference = calcCircumference(radius); printf(“Circumference = %f\n”, circumference); } double calcCircumference(int radius) { return 2 * PI * radius; } Chapter 1 — Computer Abstractions and Technology — 52 Stack Operation (general) Stacks are used to manage resources A stack Grows as items are added Shrinks as items are removed Items added/removed only at top 3 basic operations Push Add an item to the stack (on top) Pop Remove an item from the stack (from top) Peek “Take a look at” the item at the top of the stack Chapter 1 — Computer Abstractions and Technology — 53