Unit 1
Unit 1
LANGUAGE PROGRAMMING
Course Objectives
To introduce principles of computer organization and the basic architectural
concepts
Design micro instructions for different kinds of CPU organizations with proper
understanding of instruction formats and addressing modes
Identify different hardware components associated with the memory and I/O
organization of a computer
Introduction
Computer Design
Computer Architecture
Basic Terminology
Computer Software
A A computer program that tells the
device that accepts input,
processes data, stores data, and computer how to perform a
produces output, all according to a particular task
series of stored instructions
Network
Hardware Two or more computers and other
Includes the electronic and devices that are connected, for the
mechanical devices that process purpose of sharing data and
the data; refers to the computer as programs
well as peripheral devices
Data Peripheral devices
Used to expand the computer’s
Information input, output and storage
capabilities
Computing Systems
Computers have two kinds of components
Input Unit
Output Unit
Memory
Bus Structure
Input Unit:
Output Unit:
Two types are RAM or R/W memory and ROM read only memory
• Register Transfer
Registers are fast stand-alone storage locations that hold data temporarily.
Multiple registers are needed to facilitate the operations of the CPU.
MAR-Holds addresses
MDR-Holds data
Register Transfer Language (RTL)
Digital System: An interconnection of hardware modules that do a
certain task on the information
memory unit)
PC: Program Counter
R1 7 6 5 4 3 2 1 0
R2 ← R1
A bus is a set of common lines, one for each bit of a register, through
which binary information is transferred one at a time
Bus lines
D3 D2 D1 D0 C3 C2 C1 C0 B3 B 2 B 1 B 0 A3 A 2 A 1 A 0
D3 C3 B3 A3 D2 C2 B2 A2 D1 C1 B1 A1 D0 C0 B0 A0
3 2 1 0 3 2 1 0 3 2 1 0
3 2 1 0 S0
S0 S0 S0
MUX3 MUX2 MUX1 MUX0 S1
S1 S1 S1
Control input C
Three-State Buffer
Bus and Memory Transfers
S1 0
Select
S0 1
Bus line for bit 0
2×4 A0
Decoder 2
Enable E
3
B0
C0
D0
Read: DR ← M[AR]
Write: M[AR] ← DR
Example
AR
x0C 19
x12 x0E 34
R1 x10 45
100 x12 66
x14 0
x16 13
R1←M[AR] x18 22
RAM
R1 R1
100 66
Arithmetic Micro operations
B3 A3 B2 A2 B1 A1 B0 A0
C3 C2 C1
FA FA FA FA C0
C4 S3 S2 S1 S0
C3 C2 C1 C0
FA FA FA FA
C4 S3 S2 S1 S0
x y x y x y x y
HA HA HA HA
C S C S C S C S
C4 S3 S2 S1 S0
Arithmetic Circuit
3 2 1 0 S 1 S0 3 2 1 0 S 1 S0 3 2 1 0 S 1 S0 3 2 1 0 S 1 S0
Y3 X3 Y2 X2 Y1 X1 Y0 X0
C3 C2 C1
FA FA FA FA Cin
Cout D3 D2 D1 D0
OR Micro operation
Symbol: , +
Gate:
Symbol:
Gate:
Symbol: −
Gate:
Symbol:
Gate:
Symbols: and
Gate:
Symbols: and
Gate:
Most computers use only four (AND, OR, XOR, and NOT) from
which all others can be derived.
Logic Diagram Functional Table
S1
4×1
S0 S1 S0 Output Operation
MUX
Ai 0 0 E=AB XOR
Bi
0 0 1 E=AB OR
1 0 E=AB AND
1 Ei 1 1 E=A Complem
ent
The contents of the register can be shifted to the left or to the right
As being shifted, the first flip-flop receives its binary information
from the serial input
Shift Left
Transfers 0 through the serial input
? rn-1 r3 r2 r1 r0 0
rn-1 r3 r2 r1 r0
An overflow may occur in arithmetic shift-left, and occurs when the
sign bit is changed (sign reversal)
rn-1 r3 r2 r1 r0
?
? rn-1 r3 r2 r1 r0 0
Sign
Arithmetic Shift Left
Bit
Serial Input IR Serial Input IL
A3A2 A1 A0
Select
H3 H2 H1 H0
One stage of Di
arithmetic
circuit (Fig.A)
Select
Fi
Ci+1 0 4×1
1 MUX
One stage of Ei 2
logic circuit
Bi (Fig.B) 3
Ai
shr
Ai+1
shl
Ai-1
• Instruction codes
• Computer Registers
• Computer Instructions
• Instruction cycle
Instruction Codes
The control unit interprets the binary code of the instruction and
proceeds to execute it by issuing a sequence of micro-operations
Instructions
15 0
(program)
Binary Operand
Operands
(data)
15 0
Processor register
(Accumulator AC)
Indirect Address
There are three Addressing Modes used for address portion of the
instruction code:
300 1350
457 Operand
1350 Operand
+ +
AC AC
Computer Registers
Computer instructions are normally stored in consecutive memory
locations and executed sequentially one at a time
It is also necessary to provide a register in the control unit for storing
the instruction code after it is read from memory
Registers in the Basic Computer
11 0
PC
11 0
AR Memory
15 0 4096 x 16
IR
15 0 15 0
TR DR
7 0 7 0 15 0
OUTR INPR AC
List of BC Registers
DR 16 Data Register Holds memory operand
AR 12 Address Register Holds address for memory
AC 16 Accumulator Processor register
IR 16 Instruction Register Holds instruction code
PC 12 Program Counter Holds address of instruction
TR 16 Temporary Register Holds temporary data
INPR 8 Input Register Holds input character
OUTR 8 Output Register Holds output character
Computer Registers - Common Bus System
LD (load): When enabled, the particular register receives the data
from the bus during the next clock pulse transition
AR and PC: have 12 bits each since they hold a memory address
S2
S1 Bus
S0
Memory unit 7
4096 x 16
Address
Write Read
AR 1
LD INR CLR
PC 2
LD INR CLR
DR 3
LD INR CLR
Adder E
and AC 4
logic
LD INR CLR
INPR
IR 5
LD
TR 6
LD INR CLR
OUTR
Clock
LD
16-bit common bus
15 14 12 11 0
I Opcode Address
T0
AR PC
T1
IR M[AR], PC PC + 1
T2
Decode Opcode in IR(12-14),
AR IR(0-11), I IR(15)
T3 T3 T3 T3
Execute Execute AR M[AR] Nothing
input-output register-reference
instruction instruction
SC 0 SC 0 Execute T4
memory-reference
instruction
SC 0
D'7IT3: AR ←M[AR]
D'7I'T3: Nothing
D7I'T3: Execute a register-reference instr.
D7IT3: Execute an input-output instr.