1st Lecture PDF
1st Lecture PDF
Computer Organization
and
Architecture
Topics to be discussed Topics to be discussed
Introduction, Organization and ALU Design: Adder, Multiplier, Divisor
Architecture Booth’s Algorithm
IAS Structure Floating point Representation and Arithmetic,
Computer Evolution and Performance Hardware
Pipelining Instruction Sets: Characteristics and Functions
Superscalar and Parallel Processing Addressing Modes and Formats
Multicore Processor and system Instruction-Level Parallelism
Bus Interconnection, PCI Control Unit Operation
Cache Memory Hardware Control Design
Semiconductor Main Memory Micro-programmed control Design
DRAM Supercomputer Architecture
ROM Technology Cloud Computing Architecture
Computer Architecture: visible to programmer
How do I design a computer?
• Focuses on the structure: the way in which the components are interrelated
• Computer architecture includes many elements such as
•Instruction sets and formats
•Operation codes
•Data types & Data Representation
•Register architecture with CPU
•Addressing modes
•Input/Output Mechanism
• The architecture of a system directly affects the logical execution of programs.
• The computer architecture for a given machine is the combination of its hardware
components plus its instruction set architecture (ISA).
• The ISA is the interface between all the software that runs on the machine and the
hardware
Computer organization: How does a computer work?
0101000001111111
1100000111100000
0101010100001111
1110000000111111
0101000001111111
1100000111100000
0101010100001111
1110000000111111
Main Memory: Semiconductor ICs
RAM(Random Access Memory)
•Memory is an array of storage, each having capacity of 8 bits or so
and holds program and data in binary format
User Program Module
& Data 1 0 1 0 0 1 1 1
0101000001111111
1100000111100000 1 0 0 1 1 0 1 1
0101010100001111
1110000000111111
0101000001111111
1100000111100000
0101010100001111
1110000000111111
IC Internal of
Address Address Contents (Machine code & data)
in HEX in Binary
Each row is 0H 0 0 0 0
uniquely 1 0 0 0 1 1 1 0
identified by a 1H 0 0 0 1 0 1 0 0 1 1
number/code, 0 1
starting from 2H 0 0 1 0
‘0’, called
Address, usually 3H 0 0 1 1
represented in
Hexadecimal
form and used
in Assembly
language
programming
7H 0 1 1 1
Address Address Contents (Machine code or data)
in HEX in Binary
If each location 0H 0 0 0 0
1 0 0 0 1 1 1 0
of memory
contains 8 bits 1H 0 0 0 1 0 1 1 1
0 0 0 1
or 1 byte, then
it is called 2H 0 0 1 0
Byte-Addressabl 3H 0 0 1 1
e memory
7H 0 1 1 1 0
1 0 1 0 1 0 1
Capacity of Memory
• Example: 1KB: Approximately 1 Thousand (exact value 1024) locations each having
capacity of 8 bits/1Byte
• Address starts at 0 and ends at 1 less than 1 Thousand, actually encoded in BINARY
• In Binary, first address requires 1 bit (0) and final addressable location requires 10
bits (all 1’s: 11…11), since 210 = 1K
• For ease of Decoder design, uniform address format is used for all the locations;
Maximum number of bits!
• Address starts at 0 and ends at 1 less than 1 Million, actually encoded in BINARY
• In Binary, first address requires 1 bit (0) and final addressable location requires 20 bits (all
1’s: 11…11), since 220 = 1M
• For ease of Decoder design, uniform address format is used for all the locations;
Maximum number of bits!
• Special Purpose:
• Holds address of main memory locations where instructions are loaded by
Operating system.
• Holds address of main memory locations where data are stored
• Holds address of main memory locations used for special purposes
• Holds machine code of Instructions
• Holds status of CPU
CPU memory
Accumulator
General Purpose
Status register
Index register
Flag Register
Program Counter
RAM(8 bits)
Address Contents
1256H 11000011
1257H 0010101
1258H 11001000
1259H 1000101
Computer Components Memory
CPU ADDRESS CONTENTS
125H 11001101 (Machine code of
PC
Instruction-1)
MAR
Address 126H 10001101 (Machine code of
Bus Instruction-2)
MDR 127H 11101101 (Machine code of
Data
Register Instruction-3)
File Bus
IR 128H 11011101 (Machine code of
Instruction-4)
ALU Control
Unit 200H 11000101(DATA-1)
Control
201H 11000001(DATA-1)
Bus
202H 11000111(DATA-1)
PC-Program counter Control Unit decodes
MAR-Memory Address IR-Instruction Register
Register MDR-Memory Data Register Instructions & Generates
control signals
User program
SUB AX, BX
How does computer work? MOV CX, AX
MOV DX, 0
CPU
Address
RAM(16 bits)
PC MAR Bus Address Contents
Data
MDR
Bus 1256H 001010111000011
Register
File
IR 1257H 100010111001000
CPU
Address
RAM(16 bits)
PC 1256H MAR Bus Address Contents
Data
MDR
Bus 1256H 001010111000011
Register
File
IR 1257H 100010111001000
CPU
Address
RAM(16 bits)
PC 1256H MAR 1256 Bus Address Contents
Data
MDR
Bus 1256H 001010111000011
Register
File
IR 1257H 100010111001000
Address
RAM(16 bits)
PC 1256H MAR 1256H Bus 1256H Address Contents
Data
MDR
Bus 1256H 001010111000011
Register
File
IR 1257H 100010111001000
Address
RAM(16 bits)
PC 1256H MAR 1256H Bus 1256H Address Contents
CPU
Address
RAM(16 bits)
PC 1256H MAR 1256H Bus 1256H Address Contents
Address
RAM(16 bits)
PC 1257H MAR Bus Address Contents
Data
MDR Bus 1256H 001010111000011
Register
File IR
1257H 100010111001000
CPU
Address
RAM(16 bits)
PC 1257H MAR Bus Address Contents
Data
MDR Bus 1256H 001010111000011
Register
File IR
1257H 100010111001000
Control
ALU Unit
1258H 100111111001011
Control
001010111000011 Bus
User program
STEP-8: 1st instruction is Executed SUB AX, BX
(that includes Data read from MOV CX, AX
RAM followed by ALU operation, MOV DX, 0
result stored as per instruction)
CPU
Address
RAM(16 bits)
PC 1257H MAR Bus Address Contents
Data
MDR Bus 1256H 001010111000011
Register
File IR
1257H 100010111001000
CPU
Address
RAM(16 bits)
PC 1257H MAR 1257H Bus Address Contents
Data
MDR
Bus 1256H 001010111000011
Register
File
IR 1257H 100010111001000
Binary code for ALU CPU register or memory CPU register or memory
operation address that contains address that contains
(Op Code) Data-1 (Binary) Data-2
Result is stored in same (Binary)
CPU register or memory
address after operation
ADD R1, R2 R1 R1 + R2
ADD M, R1 [M] R1 + [M]
Instruction Formats(one-operand field)
ADD M AC [M] + AC
Binary code for ALU CPU register or
operation memory address that
(Op Code) contains Data-2
(Binary)
Here Data-1 should be loaded into a predefined register, namely Accumulator (AC)
prior to use this instruction. Moreover, the result is stored into Accumulator (AC) as
well. Interestingly, the Accumulator (AC) is not explicitly indicated in the
Instruction sub-field!
ADD R1 AC R1 + AC
Instruction Formats(Opcode only!)
CLC Clear carry Flag bit
Binary code for ALU /special
operation