A graphical representation of a system, project, or scenario
Concept of registers
...
Small, permanent storage locations within the CPU, used for a particular purpose
Manipulated directly by the control unit
Wired for specific function
Size in bits/bytes
Holds data, address, or instruction
Use of registers
It holds data that may be needed quickly or frequently, and stores information about the status of the CPU and running programs
General purpose registers
They are user-visible registers that holdintermediateresults or data values. There are typically a several dozen in current CPUs
The functions of the registers can be modified by programmers to suit their program requirements
Special purpose registers
User invisible (register functionality cannot be changed)
Program counter register (PC) - keeps track of the memory addresses of the next instruction to be executed
Instruction register (IR) - stores instructions fetched from the memory
Memory address register (MAR) - holds the memory address of the data that needs to be accessed or stored
Memory data register (MDR) - holds the data that is being transferred to or from the computer's memory
Status register - holds flags indicating the outcome of arithmetic and logic operations
Register operations
...
Stores values from other locations (registers and memory)
Addition and subtraction
Shift or rotate data
Test contents for conditions such as zero or positive
Operation of memory
...
Every location has its own address
The address of an instruction is copied to the MAR which finds the location in the memory
CPU will determine if it is a store or retrieval
Transfer takes place between the MDR and memory
MDR is a two-way register (data travels in both directions), MAR is not
Relationship between MAR, MDR and Memory
MAR and MDR facilitate CPU communication with the memory, which allows the CPU to retrieve and store data to and from specific memory locations
Memory capacity
Determined by 2 factors:
Number of bits in the MAR - 2^k where k = width of the register in bits
Size of the address portion of the instruction - 4 bits allow 16 locations, 8 bits allow 256, 32 bits allow ~4GB
Types of RAM
DRAM (dynamic RAM):
Most common, cheap, uses less power/heat/space
Volatile - must be recharged thousands of times/sec
SRAM (static RAM):
Faster but more expensivethanDRAM, volatile, small amounts are often used in cache memory for high-speedmemory access
Non-volatilememory
...
ROM
EEPROM - Electrically Erasable Programmable ROM
Flash memory - faster but more expensive than disks, slow rewrite time compared to RAM
Fetch-execute-cycle
Two-cycle process because both instructions and data are in memory
Fetch - decode or findsinstruction, loads from memory into register and signals ALU
Execute - moves/transforms data, performs operations that instruction requires
Load fetch/execute cycle
PC --> MAR = Transfers the address from PC to MAR
MDR --> IR = Transfers instructions to IR
IR[address] --> MAR = Address portion of the instruction loaded into MAR
MDR --> A = Actual data copied into accumulator
PC + 1 --> PC = Program counter incremented
Store fetch/execute cycle
PC --> MAR = Transfers the address from PC to MAR
MDR --> IR = Transfers instructions to IR
IR[address] --> MAR = Address portion of the instruction loaded into MAR
A --> MDR = Accumulator copies data into MDR
PC + 1 --> PC = Program counter incremented
Add fetch/execute cycle
PC --> MAR = Transfers the address from PC to MAR
MDR --> IR = Transfers instructions to IR
IR[address] --> MAR = Address portion of the instruction loaded into the MAR
A + MDR --> A = Contents of MDR added to contents of accumulator
PC + 1 --> PC = Program counter incremented
What is bus?
An electronic pathway through which data can be transferred from one location in the computer system to another
Groups of electrical or optical conductors for carrying signals from one location to another. Buses can be wires or conductors printed on a circuit board or a line
4 kinds of signals
Data
Addressing
Control signals
Power (sometimes)
Bus characteristics
...
Number of separate conductors
Addressing capacity
Type of control required
Defined purpose
Features and capabilities
Bus categorizations
...
Parallel v.s serial buses
Direction of transmission - simplex is unidirectional, half duplex is bidirectional but only one direction at a time, full duplex is bidirectional simultaneously
Method of interconnection - point-to-point is a single source to single destination (cables are point-to-point buses that connect an external device)
Multipoint bus - broadcast bus or multidrop bus (connect multiple points to one another)
Parallel v.s serial buses
Parallel:
Expensive and uses lots a space
Generally used for short distances (e.g CPU buses & computer motherboards)
High throughput because all bits of a word are transmitted simultaneously
Serial:
1 bit transmitted at a time
Single data line pair and a few control lines
For many applications, throughput is higher than parallel due to the lack of electrical interference
Classification of instructions
...
Data movement (load, store)
Arithmetic
Boolean logic
Bit manipulation instructions
Shift and rotate
Program control
Stack instructions
I/O and machine control
Instructions
They are directionsgiven to a computer, it causes electrical or optical signals to be sent through specific circuits for processing
Instruction set defines the functions performed by the processor, it differentiates computer architecture by the format, number of instructions, use of registers, and addressing