Académique Documents
Professionnel Documents
Culture Documents
15 0
4095
Instruction codes
INSTRUCTIONS
Program
A sequence of (machine) instructions
(Machine) Instruction
A group of bits that tell the computer to perform a specific operation (a
sequence of micro-operation)
INSTRUCTION FORMAT
A computer instruction is often divided into two parts
An opcode (Operation Code) that specifies the operation for that instruction
An address that specifies the registers and/or locations in memory to use for
that operation
Addressing
mode
Stored Program Concept
CPU consists of ALU & CU Program + Data on same memory
Main Memory But each memory location must be
addressed independently.
INPUT & OUTPUT System
Single path between main memory &
control unit, so control signal cant
MEMORY exchange simultaneously.
Address Data & Instruction
7 Interconnection
Interconnection
REGISTER 4
5 ALU
CONTROL UNIT
2
I/O
Von-neuman Architecture
Instruction codes
ADDRESSING MODES
The address field of an instruction can represent either
Immediate Address Address part of instruction specifies an operand
Direct address Address part of instruction specifies the address of operand
Indirect address Address part of instruction specifies an address of memory
word in which the address of operand is found.
One bit of instruction code can be used to differentiate between direct & indirect
address. Direct addressing Indirect addressing
300 1350
457 Operand
1350 Operand
+ +
AC AC
11 0
PC
Memory
11 0
4096 x 16
AR
15 0
IR CPU
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
Registers
COMMON BUS SYSTEM
Output of 7 Registers & memory connected to common bus.
Binary value of S2, S1, S0 selects different options to common bus.
Example:- When S2S1S0 011, then 16bit O/P of DR are placed on bus line.
Lines from common bus are connected to Input of each register and data Input of memory.
If the LD (Load) input of register is enable then receives data from bus in next clock cycle.
Memory receives data when its WRITE input is activated.
Memory places its 16bit output to bus when its READ input is activated & S2S1S0 111.
When AR & PC (12 bit) connected to 16bit common bus then
4 most significant bits are set to 0
12 least significant bits are transferred in to the register.
INPR & OUTR (8 bit each) communicate with 8 least significant bit in bus.
INPR receives data from input device which is transferred to ACC.
OUTR receives data from ACC & deliver it to output device.
AR, PC, DR, AC, TR Having LD(Load), INR (Increment), CLR (Clear) controls.
IR, OUTR Having only LD(Load) control.
Three inputs to ALU (ACC [16bit]+ DR [16bit]+ INPR[8bit]).
Enabling LD input of DR Transfer content of DR through ALU to ACC
Enabling LD input of ACC Transfer content of ACC to DR by control S2S1S0 100.
E Flip flop to store extended bit (carry bit).
Registers
COMMON BUS SYSTEM
S2
S1 Bus
S0
S2 S1 S0 Register Memory unit 7
0 0 0 x 4096 x 16
0 0 1 AR Address
0 1 0 PC Write Read
0 1 1 DR AR 1
1 0 0 AC
1 0 1 IR LD INR CLR
1 1 0 TR
PC 2
1 1 1 Memory
LD INR CLR
DR 3
LD INR CLR
E
ALU AC 4
LD INR CLR
INPR
IR 5
LD
TR 6
LD INR CLR
OUTR
Clock
LD
16-bit common bus
Instructions
Instruction Types
Functional Instructions
- Arithmetic, logic, and shift instructions
- ADD, CMA, INC, CIR, CIL, AND, CLA
Transfer Instructions
- Data transfers between the main memory
and the processor registers
- LDA, STA
Control Instructions
- Program sequencing and control
- BUN, BSA, ISZ
Input / Output Instructions
- Input and output
- INP, OUT
Instruction codes
CONTROL UNIT
Control unit (CU) of a processor translates from machine instructions to
the control signals for the micro-operations.
A master clock generator controlling the time for all registers.
Clock pulses are applied to the register & flip-flops in control unit.
Control units are implemented in one of two ways
Hardwired Control
CU is made up of sequential and combinational circuits to generate the control signals
Micro-programmed Control
A control memory on the processor contains micro-programs that activate the necessary
control signals
3x8
decoder
7 6543 210
D0
I Combinational
D7 Control Control
logic signals
T15
T0
15 14 . . . . 2 1 0
4 x 16
decoder
TIMING SIGNALS
- Generated by 4-bit sequence counter and 416 decoder
- The SC can be incremented or cleared.
T0
T1
T2
T3
T4
D3
CLR
SC
INSTRUCTION CYCLE
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.