![Page 1: Computer Systems Organization CS 1428 Foundations of Computer Science](https://reader035.vdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba01ee/html5/thumbnails/1.jpg)
Computer Systems Organization
CS 1428 Foundations of Computer Science
![Page 2: Computer Systems Organization CS 1428 Foundations of Computer Science](https://reader035.vdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba01ee/html5/thumbnails/2.jpg)
2
Objectives
In this section, you will:
Review binary data representation
Put all the pieces together – the Von Neumann architecture
Why getting more memory will help your computer run faster
Learn how C++ programs are run by the computer
![Page 3: Computer Systems Organization CS 1428 Foundations of Computer Science](https://reader035.vdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba01ee/html5/thumbnails/3.jpg)
Software
Programs are stored in a binary format that is specific to the processor (or virtual machine, in the case of Java)
High-level language programs must be “compiled” into machine language that is targeted toward a specific processor or operating system
3
![Page 4: Computer Systems Organization CS 1428 Foundations of Computer Science](https://reader035.vdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba01ee/html5/thumbnails/4.jpg)
From a High-level Program to an Executable File
Slide 1- 4
Source Code
Preprocessor
ModifiedSource Code
Compiler
Object Code
Linker
Executable Code
![Page 5: Computer Systems Organization CS 1428 Foundations of Computer Science](https://reader035.vdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba01ee/html5/thumbnails/5.jpg)
5
Representing integers
Decimal integers are converted to binary integers
Given k bits, the largest unsigned integer is 2k - 1
Given 4 bits, the largest is 24-1 = 15
Signed integers must also represent the sign (positive or negative)
Integers often represented in two’s complement
Binary Representation of Numeric and Textual Information
![Page 6: Computer Systems Organization CS 1428 Foundations of Computer Science](https://reader035.vdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba01ee/html5/thumbnails/6.jpg)
6
Characters are mapped onto binary numbers ASCII code set
8 bits per character; 256 character codes
What is the numeric code for a capital A? In binary?
UNICODE code set
16 bits per character; 65,536 character codes
Text strings are sequences of characters in some encoding
Binary Representation of Numeric and Textual Information (continued)
![Page 7: Computer Systems Organization CS 1428 Foundations of Computer Science](https://reader035.vdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba01ee/html5/thumbnails/7.jpg)
7
Representing real numbers Approximations
Not possible to store all real numbers
Real numbers may be put into binary scientific notation: a x 2b
Example: 101.11 x 20
Number then normalized so that first significant digit is immediately to the right of the binary point
Example: .10111 x 23
Mantissa and exponent then stored
Binary Representation of Numeric and Textual Information (continued)
![Page 8: Computer Systems Organization CS 1428 Foundations of Computer Science](https://reader035.vdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba01ee/html5/thumbnails/8.jpg)
8
Representing other data
Almost any analog information can be “digitized” to store on a computer Sound Pictures Video
![Page 9: Computer Systems Organization CS 1428 Foundations of Computer Science](https://reader035.vdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba01ee/html5/thumbnails/9.jpg)
9
The Components of a Computer System
Von Neumann architecture has four functional units: Memory Input/Output Arithmetic/Logic unit Control unit
Sequential execution of instructions Stored program concept
![Page 10: Computer Systems Organization CS 1428 Foundations of Computer Science](https://reader035.vdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba01ee/html5/thumbnails/10.jpg)
10
Components of the Von Neumann Architecture
Bus
Cache
![Page 11: Computer Systems Organization CS 1428 Foundations of Computer Science](https://reader035.vdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba01ee/html5/thumbnails/11.jpg)
11
Memory and Cache
RAM (Random Access Memory) Memory made of addressable 8 bit “cells”
Memory address
Unsigned binary number N bits long
Address space is then 2N cells
Fetch/store controller Fetch: retrieve a value from memory
Store: store a value into memory
![Page 12: Computer Systems Organization CS 1428 Foundations of Computer Science](https://reader035.vdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba01ee/html5/thumbnails/12.jpg)
12
Memory and Cache (continued)
Memory register
Very fast storage location
Given a name, not an address
Serves some special purpose
Modern computers have dozens or hundreds of registers
![Page 13: Computer Systems Organization CS 1428 Foundations of Computer Science](https://reader035.vdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba01ee/html5/thumbnails/13.jpg)
13
Cache Memory
Memory access is much slower than processing time
Faster memory is too expensive to use for all memory cells
Locality principle
Once a value is used, it is likely to be used again
Small size, fast memory just for values currently in use speeds computing time
![Page 14: Computer Systems Organization CS 1428 Foundations of Computer Science](https://reader035.vdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba01ee/html5/thumbnails/14.jpg)
CPU
Control Unit Manages execution
Arithmetic and Logic Unit (ALU) Does calculations
14
![Page 15: Computer Systems Organization CS 1428 Foundations of Computer Science](https://reader035.vdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba01ee/html5/thumbnails/15.jpg)
15
The Control Unit
Manages stored program execution
Task
Fetch from memory the next instruction to be executed
Decode instruction: determine what is to be done
Execute instruction: issue appropriate command to ALU, memory, and I/O controllers
Decode
Execute
Fetch
Instruction Cycle
![Page 16: Computer Systems Organization CS 1428 Foundations of Computer Science](https://reader035.vdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba01ee/html5/thumbnails/16.jpg)
16
Control Unit Registers And Circuits
Parts of control unit Links to other subsystems Instruction decoder circuit Three special registers:
Program Counter (PC) Stores the memory address of the next instruction to
be executed
Instruction Register (IR) Stores the code for the current instruction
Accumulator (ACC) Where the results of all arithmetic operations and
loads is stored.
![Page 17: Computer Systems Organization CS 1428 Foundations of Computer Science](https://reader035.vdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba01ee/html5/thumbnails/17.jpg)
17
The Arithmetic/Logic Unit
Actual computations are performed
Primitive operation circuits Arithmetic (ADD, etc.)
Comparison (CE, etc.)
Logic (AND, etc.)
Data inputs and results stored in registers
Multiplexor selects desired output
![Page 18: Computer Systems Organization CS 1428 Foundations of Computer Science](https://reader035.vdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba01ee/html5/thumbnails/18.jpg)
18
Machine Language Instructions
Can be decoded and executed by control unit Always in binary!!
Parts of instructions
Operation code (op code)
Unique unsigned-integer code assigned to each machine language operation
Address field(s)
Memory addresses of the values on which operation will work
![Page 19: Computer Systems Organization CS 1428 Foundations of Computer Science](https://reader035.vdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba01ee/html5/thumbnails/19.jpg)
19
Machine Language Instructions (continued)
Operations of machine language
Data transfer
Move values to and from memory and registers
Arithmetic/logic
Perform ALU operations that produce numeric values
![Page 20: Computer Systems Organization CS 1428 Foundations of Computer Science](https://reader035.vdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba01ee/html5/thumbnails/20.jpg)
20
Machine Language Instructions (continued)
Operations of machine language (continued)
Compares
Set bits of compare register to hold result
Branches
Jump to a new memory address to continue processing
![Page 21: Computer Systems Organization CS 1428 Foundations of Computer Science](https://reader035.vdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba01ee/html5/thumbnails/21.jpg)
21
Pippin ViewAssembly language(Closer to Human Language)
Machine Language(Only thing a computer understands.)
Copyright Notice©2003 PWS Publishing Company, All
Rights Reserved.
![Page 22: Computer Systems Organization CS 1428 Foundations of Computer Science](https://reader035.vdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba01ee/html5/thumbnails/22.jpg)
22
Program:LOD #00000011ADD 10000000STO 10000011HLT
Note the error in the documentation. The STO op code is really 0000 0101.
![Page 23: Computer Systems Organization CS 1428 Foundations of Computer Science](https://reader035.vdocuments.us/reader035/viewer/2022062518/56649e9e5503460f94ba01ee/html5/thumbnails/23.jpg)
23
Summary Computer organization examines different
subsystems of a computer: memory, input/output, arithmetic/logic unit, and control unit
Machine language gives codes for each primitive instruction the computer can perform, and its arguments
Von Neumann machine: sequential execution of stored program