Docsity

Program Counter-Digital System Design-Lab Mannual, Exercises of Digital Systems Design

Toggle sidebar
bg1
HDL Based Design
HDL
Based
Design
LAB # 07
Verilog
Implementation of Program Counter &
Verilog
Implementation
of
Program
Counter
&
Instruction Memory Logic
WHAT WE HAVE DONE SO FAR?
Our Processor Elements
• ALU --------------------Done
• Registers -----------------Done
• Memory ------------------Done
• PC & Instruction Memor
y
------To Do
y
wr_addr rd_addr0 rd_addr1
clock
555
32 32
32
Sign Extended 32 bit Const.
Immediate_Enable msel __
R/W
clock
32 {R[0]-R[31]}
32-bit
Registers
rd_data0
rd_data1
wr_data wr_en
B
A
3
2
32 address
32
Add_or_sub
LF
data_in
ALU
B
A
Fdata_out
32
LF
ST
SD
Load_Enable
Program Counter
4
•Sequential Instruction Fetch
4
+Instruction
Memory
t
Program Counter addr
data
32
clock
rese
t
pf3

Partial preview of the text

Download Program Counter-Digital System Design-Lab Mannual and more Exercises Digital Systems Design in PDF only on Docsity!

HDL Based DesignHDL

Based Design

LAB # 07

Verilog

Implementation of Program Counter &

Verilog

Implementation

of Program Counter &Instruction Memory Logic

WHAT WE HAVE DONE SO FAR?

Our Processor Elements • ALU - - - - - - - - - - - - - - - - - - - -Done• Registers - - - - - - - - - - - - - - - - -Done • Memory - - - - - - - - - - - - - - - - - -Done• PC & Instruction Memory - - - - - -To Do

y

wr_addr^

rd_addr^

rd_addr

clock

5

5 5

32

32 Sign Extended 32 bit Const.^32

Immediate_Enable

msel

__ R/W clock

32 {R[0]-R[31]}32-bitRegisters

rd_data0rd_data wr_data wr_en

B

32 A

32

address (^32) Add_or_subLF

data_in

ALU^

B

A^ F

32 data_out LFSTSD^ Load_Enable

Program Counter

•^ Sequential Instruction Fetch

InstructionMemory

t^ Program Counter

addrdata 32

reset^ clock

docsity.com

Program Counter

(Cont’d)

4

•^ Branch Supportext_offsetbeq beqorbneq(if true)

+^

InstructionMemoryMemory

Program Counter

addrdata 32

reset clock

Program Counter

(Cont’d)

•^ Branch & Jump Support

4 ext_offset ______jmp_im jmp_ind

beq_bne(if true)rd data1im addr

+^

InstructionMemory

rd_data im_addr jmp_ind

Program Counter

addrdata 32

reset clock ______jmp_im

32

Instruction Memory

reg [7:0]IM[0: .....;^ •^

Mem File I/OMem File I/O^ ¾^ address -> Mem Addressto Read/Write^ ¾^ data -> Data to Read/Write^ from/at Mem [address].

2 Kx

address 32

data^

7

Instructions to embed^ •^ bneq R1,R2,Label

or

beq R1,R2,Label

¾^ Branch if not equal

or^

Branch if equal. q^

q

¾^ Branches to the address determined by the offset Label01 ifcontents of Register $R1 and $R2 are equal or not equaldepending on the instruction. J^

i^ # dd

•^ Jmp_im #address^ ¾

Jump Immediate. ¾ Jumps to the location determined by the immediate address. J i d ($R1)

• Jmp_ind ($R1)^ ¾

Jump Indirect. ¾ Jumps to the address location determined by the contents ofthe Register $R

(Reg

File Output rd data1)

the Register $R1.

(Reg^

File^ Output rd_data1)

docsity.com