Professional Documents
Culture Documents
We were instructed to design a 4-bit PC. We used SAP-1, 2 and 3s concepts and cumulatively
tried to design a PC which consists of data bus of 4 bits. Bidirectional transmission and stack
pointer are implemented in our PC. We were given instruction sheet for each groups. We
designed, simulated the PC on Proteus and finished report regarding this. There were some
additional specifications that we had to implement here. Those are:
Instruction Set
LDA address; STA address; MOV Acc, B; MOV B, Acc; MOV Acc, immediate; IN; OUT; ADD B; ADC B; SUB
B; SBB B; ADC [address]; SBB [address]; CMP B; DEC; JNO address; JG address; PUSH; POP; CALL address;
RET; JMP; HLT; NOP; RCL; RCR; AND B; XOR B
Instruction
LDA address
STA address
MOV Acc, B
MOV B, Acc
MOV Acc, immediate
IN
OUT
ADD B
ADC B
SUB B
SBB B
ADD [address]
ADC [address]
SUB [address]
SBB [address]
ADD immediate
ADC immediate
Description
Acc <- Memory [address]
SUB immediate
SBB immediate
PUSH
POP
CALL address
RET
JMP address
HLT
AND B
OR B
XOR B
AND [address]
OR [address]
XOR [address]
AND immediate
OR immediate
XOR immediate
NOT
NEG
XCHG
SHL
SHR
ROL
ROR
RCL
RCR
INC
DEC
CMP B
TEST B
CMC
CLC
STC
CLS
STS
CLZ
STZ
JC address
JNC address
JZ address
JNZ address
JO address
JNO address
JE address
JNE address
JG address
JL address
NOP
b) Instruction Memory
Instruction memory is 256x8 RAM. It has 8 output and address pins separately.
Thus byte addressable. Each byte contains the desired instructions. The read
signal is always activated. Since address inputs are directly connected to the PC,
hence the memory output is always available without requiring any extra clock
cycle. There is no need to write instruction memory. Because we used separate
memory for data and instruction. Data writes and stack writes take place in the
data memory. Only at the start of the simulation program code needs to be
loaded in the instruction ROM.
2. Execution Unit
It performs arithmetic and logical operations, transfers values between registers and
data memory.
S0
0
1
0
1
Operand
B Register
1
Data memory output
Instruction memory buffer register output
b) Register
The entire register set consists of:
2 general purpose registers Accumulator and B.
1 program status register or flags register.
1 temporary register.
1 input port register.
1 output port register.
c) Functions of Registers
Temp Register: This is used for stack or call instructions. Used for
swapping contents to and from accumulator and B.
Input Port Register: Used for interfacing with outside world. It receives
data from external devices.
Output Port Register: Used for interfacing with outside world. It sends
data to external devices.
ZF
OF
SL.
Control Containing
On Active State
No
bit
Register
INL
Input Port
EIP
Input Port
PC_AC
TIVE
Program
Counter
L/I
Program
Counter
EP
Program
Counter
MARL
Memory
Address
Register
6
EMA
Memory
Address
Register
7
~LR
RAM
ER
RAM
~LMD
Memory
Data
Register
10
EMD
Memory
Data
Register
11
~LIR
Instruction
Register
12
EIR
Instruction
Register
13
~LA
Accumulat
or
14
EA
Accumulat
or
15
S2
Arithmetic
Logic Unit
000=Add/Adc
100=AND
Arithmetic
001=Sub/SBB
101=XOR
Logic Unit
010=CMP
110=RCL
Arithmetic
011=NOT
111=RCR
16
17
S1
S0
Logic Unit
18
EC
Arithmetic
Logic Unit
19
EALU
Arithmetic
Logic Unit
20
~LB
21
EB
22
~LT
Temporary
Address
Register
23
ET
Temporary
Address
Register
24
~LSP
Stack
Pointer
25
ISP
Stack
Pointer
26
ESP
Stack
Pointer
27
DSP
Stack
Pointer
28
~LO
Output
Register
29
~NOP
Quantity
6
8
2
3
1
2
2
1
2
1
1
3
15
7
6
5
1
2
1
3
2
1
1
6
1
1
References
U1, U5, U26, U41, U46, U65
U2, U7, U21, U28, U43, U50, U57,
U3, U51
U4, U6, U18
U8
U9, U79
U10-U11
U12
U13, U55
U14
U15
U16, U59-U60
U17, U23, U32, U38-U39, U47U48, U52, U68, U75, U80, U83-U86
U19, U54, U56, U61-U64
U20, U29, U31, U33, U36-U37
U22, U24-U25, U34-U35
U27
U30, U44
U40
U42, U45, U77
U49, U76
U53
U58
U66, U69-U73
U67
U74
Value
74LS193
U78 74LS04
74LS08
74LS244
74LS10
74LS11
FUNCTION_4_8
74HC139
7404
4030
7432
4019
74LS157
74126
74LS126
74LS173
74LS20
74LS32
74LS02
74HC4002
74LS21
6116
74LS86
2732
7408
74173
Discussion
We used Proteus for the simulation, hence we were able to make the design flexible.
We designed this with easy to handle wireless terminal method by giving label the
important components.
We have separated data and instruction memory. This reduced number of average clock
cycles for those instructions to be nearly one.
The design contains 4-bit data bus, there is no address bus in our design as we
implemented two stage pipe lining.
Average CPI is calculated 1.5368 and total ICs used is 55 only which fulfills the
requirements of this assignment.
We faced some preliminary difficulties regarding Proteus usage. Critical sections and
operations on the simulation software were handled carefully for the experiment.
Lab Group: A1
Group : 2
Submitted By:
1105002
1105004
1105021
1105022
Submission date:
9.5.16