Docsity

Data Path Elements-Digital System Design-Lab Mannual, Exercises of Digital Systems Design

Toggle sidebar
bg1
HDL Based Design
HDL
Based
Design
LAB # 06
Data Path Elements: Verilog Implementation 2
Data
Path
Elements:
Verilog
Implementation
2
WHAT WE HAVE DONE SO FAR?
(C
(
THE PA
C
E WILL BE A LTTLE
SLOW IN THIS LAB SO AS TO
GIVE SOME OF YOU TIME TO
GIVE
SOME
OF
YOU
TIME
TO
REACH THE REST OF THE CLASS).
Data Path Elements
•
A
LU -------------------Done.
• Registers ----------------Done.
• Memory -----------------To Do.
So Let’s interface the memor
y
with the ALU and
y
Registers we have implemented in the previous
Lab.333
32
Sign Extended 32 bit Const.
Immediate Enable
8 {R[0]-R[7]}
wr_addr rd_addr0 rd_addr1
rd_data0
clock B
A
32
32
32
Immediate
Enable
32-bit
Registers
rd_data1wr_data
wr en
A
F
U
32
32
wr
_
en
Memory File
reg
[31:0]Mem
…………;
•
Mem File I/O
msel __
R/W
Mem
File
I/O
¾msel-> Memory Select.
¾R/W -> Mem Read/Write
Control Signal.
clock
data_in
32
¾address -> Mem Address
to Read/Write
¾data -> Data to Read/Write
from/at Mem [address]
2 Kx32
address
32
from/at
Mem
[address]
.
data_out
32
4
docsity.com
pf2

Partial preview of the text

Download Data Path Elements-Digital System Design-Lab Mannual and more Exercises Digital Systems Design in PDF only on Docsity!

HDL Based DesignHDL

Based Design

LAB # 06

Data Path Elements: Verilog Implementation 2Data

Path Elements: Verilog Implementation 2

WHAT WE HAVE DONE SO FAR?(

C

(THE PACE WILL BE A LTTLESLOW IN THIS LAB SO AS TOGIVE SOME OF YOU TIME TOGIVE SOME OF YOU TIME TOREACH THE REST OF THE CLASS).

Data Path Elements •

ALU - - - - - - - - - - - - - - - - - - - Done.

Registers - - - - - - - - - - - - - - - - Done.

Memory - - - - - - - - - - - - - - - - - To Do.So Let’s interface the memory with the ALU and

y

Registers we have implemented in the previousLab.

Sign Extended 32 bit Const.

Immediate Enable

8 {R[0]-R[7]}

wr_addr

rd_addr

rd_addr

rd_data

clock

B

A L

Immediate Enable

32-bit Registers

rd_data

wr_data

wr en

A

F

LU

wr

_en

Memory File

reg

[31:0]Mem…………;

Mem File I/O

msel

__

R/W

Mem

File I/O

msel-> Memory Select.

R/W -> Mem Read/WriteControl Signal.

c

lock

data_in

address -> Mem Addressto Read/Write

data -> Data to Read/Writefrom/at Mem [address]

2 Kx

address

from/at

Mem [address].

data_out

docsity.com

ALU-RegFile Interface with Memory

Sign Extended 32 bit Const.

wr_addr

rd_addr

rd_addr

rd_data

clock

Immediate_Enable

msel

__

R/W

clock 32

8 {R[0]-R[7]}

32-bit Registers

rd_data

wr_data

address

Add_or_sub

data_in

wr_en

ALU

B

A

LFSTSD

F

data_out

L^

d E

bl

Load_Enabl

Instructions to embed^ •

load $R1,($R2)

Load Indirect.

Load from Memory Address indicated by the contentsof Register $R2 to the Register $R1.

store ($R2),$R

Store Indirect.

Store the contents of Register $R1 to the MemoryAddress indicated by the contents of Register $R2.

LAB-WORK # 06

EXERCISE # 01

DATA PATH ELEMENTS DESIGN 2 A.

Complete your previous Modification of ALU_Reg Code (BEHAVIORAL) tomatch the specifications and design of the ALU presented in previous LAB ?(if not completed then get ready for marks deduction and if completed then(if not completed then get ready for marks deduction and if completed thenwell done).

B.

Interface a Memory (2Kx32) to the ALU_Reg designed in previous Lab.Initialize the Memory with some constants in ascending order.

wr_addr

rd_addr

rd_addr^1

clock

Sign Extended 32 bit Const.

Immediate_Enable

msel

__

R/W

clock

8 {R[0]-R[7]}

32-bit Registers

rd_data0rd_data

wr_data

wr_en

B

A

32

address

Add_or_subLF

data_in

ALU

B

A

F

data_out

LFSTSD

LAB-WORK # 06

EXERCISE # 02

DATA PATH ELEMENTS DESIGN 2 A.

Design a test module named testALU_REG_Mem and tBench for

EXERCISE # 01 which tests all possible instructions that can be implemented onthe given design?

module tBench;

the given design?

module ALU_REG_Mem(……);

RegA

moduletestALU_REG_Mem(...);

B

RegBRegC


O t

Ctrl

RegCCtrlOut

endmodule

endmodule

Out

Flags

endmodule

Its better to shift it out here if you have more than onedesign modules and you have to write test module for each.

docsity.com