Von Neumann Model
- Program Counter: Counts the number of instructions. Where a computer is in its execution
- Instruction register - Holds the instruction currently being executed
- MAR: Memory Address Register – Stores memory addresses
- MDR: Memory Data Register – Store data in memory
- ITS ALL ONES AND ZEROS XD
Memory
-
K x M
array stored bits (k is usually 2^n) - Address
- Unique n-bit identifier of location
- Contents
- m-bit value stored in location
- Addressability
- The size of the memory location referenced by a given address
- A word is a basic unit of data used by the processing unit (usually multiple bytes)
- Basic operations
- LOAD: read a value from a memory location
1. Write the address (A) into the MAR 2. Send a read signal to the memory 3. Read data from the MDR
- STORE: write a value to a memory location
1. Write the dara to the MDR 2. Write the address into the MAR 3. Send a write signal to memory
- LOAD: read a value from a memory location
- LC3 : 16 bit addresses, 16 bit values
Processing Unit
Contains the ALU and the Register File
SR, D R
Source Register and Destination Register. You would add two registers, through the ALU which is process it and then store it in a destination register.
Functional units
- ALU; Has an adder and other components like multiply and square root
- LC-3 Performs ADD, AND, NOT
Registers
- Small storage
- Operands and results of functional units
- LC-3 has eight registers (R0..R7) each 16 bits wide
Word Size
- number of bit normally processed by the ALU in one instruction
- also width of registers
- LC-3 is 16 bits
SR2MUX
The multiplexer controls what ALU process is going to be used
Control Unit
- Conductor of an orchestrates
Instruction Register
Contains the current instruction.
Program Counter
Contains the address of the next instruction to be execution
Control Unit
- Reads instructions from memory
- Interprets the instruction, generate singals that tell the other components what to do.
Input and Output
- Devices for getting data into and out of computer memory
- Each device has its own interface, usually a set of registers like the memory’s MAR and MDR
- LC-3 Supports keyboard input and console output
- Keyboard: data reg (KBDR) and status (KBSR)
- Monitor: data reg (DDR) and status (DSR )
- Some devices provie both input and output
- disk, network
- Program/Software that controls access to a device is usually called a
driver
Instruction Processing
- There are limited sets of instructions in LC-3
Instructions are encoded as a sequence of bits as data in memory.
Format:
[4 bit opt code][12 bit operand]
operation data to be used for operation
-
Control unit interprets instruction: Generates a sequence of control ignal to carry out operation.
-
Every operation is either executed completely or not at all.
-
Instruction sets are known as ISA
-
Kinds of instructions
- Computational (ADD, AND)
- Data movememnt (LD, ST)
- Control instructions (JMP, BRnz)
Every operation that starts needs to finish
- Fetch operation: load an instrcution (at address stored in PC) from memory into IR.
- Load contents of PC into MAR
- Send “read” signals to memory
- Copy the MDR content to IR
- Increment PC so that it points to this instruction
- PC <- PC+1
- Decoding:
- Identify the op code (first four bits in LC-3)
- Depending n the op code look at the other operations
- Obtain source operands needed to perform operation
- Execute:
- Perform the operation using the source operand
- Executing the ADD operation of LC-3
- Store:
- Writes results to destination (Register or memory)
- Memory store: Write address to MAR, data to MDR, assert WRITE signal to memory
Fetch - Decoding - Execute - Store
Changing the sequence of execution
- In the FETCH phase, we incremented PC by 1.
-
What if don’t want to always execute the instrcution that follows this one? - Loop/If then
- Control Instructions
- Branches are conditional – they change the PC only if some condition is true (So you can run certain instructions in certain cases)
- Jumps are unconditonal - they always change the PC
// Set the PC to value the contained in a register. This becomes the address of the next instruction to fetch
[JMP][000][BASE][00000]
The Clock
The clock is a signal that keeps the control unit moving. At each clock tick, control unit moves to the next machine cycle
Clock generator circuit.
- 0V (0) and 2.9V (1)