Documente Academic
Documente Profesional
Documente Cultură
RT level design:
Taking a high level description of a design
Partitioning
Control/data
Partitioning
Control/data
Control/data
Partitioning
Partitioning
RT Level Design
DataPath Control
Reg
Flags & status
Control
Data Inputs
Opcode Outputs
Data flow
Control signals
Control
Data Outputs
Inputs
Control/data
Partitioning
Data
Data Part
Part Control Part
DataPath
Reg
Flags & status
Data Inputs
Opcode
Data flow
Control signals
Data Outputs
DataPath Module
Verilog Digital System Design
Z. Navabi, 2006 7
Data Part Data Component:
Shows how the
component uses its
input control
signals to perform
module DataComponent various operations
on its data inputs
(DataIn, DataOut, ControlSignals);
Control/data
Partitioning
Outline of a Controller
done
start
Multiplier lsb-out
Clk
msb-out
Sequential
Multiplier
Shift-and-add Sequential
Multiplier
Multiplication Multiplier
Testing
Process Design
Sequential
Multiplier
Shift-and-add
Shift-and-add Sequential
Multiplier
Multiplication Multiplier
Testing
Process
Process Design
P: 0 0 0 0 A: 1 0 0 1
A and B
B: 1 1 0 1
0 1 1 0 1 1 0 0 0 0 1 1 0 1 1 0
1 1 0 1 1 1 0 1
0 0 0 1 1 0 1 1 0 1 1 1 0 1 0 1
1 1 0 1 1 1 0 1 Result
t=0
P: 0 0 0 0 A: 1 0 0 1
A and B
Because A[0] is 1, the partial
B: 1 1 0 1
sum of B + P is calculated.
0 1 1 0 1 1 0 0
1 1 0 1 Because A[0] is 0,
0000 + P is calculated
t=2 0110+0000 00110
0 0 1 1 0 1 1 0
0 0 0 1 1 0 1 1
1 1 0 1
0 1 1 1 0 1 0 1
Sequential
Multiplier
Shift-and-add Sequential
Sequential Multiplier
Multiplication Multiplier
Testing
Process Design
Design
Datapath Multiplier
Description Controller
Top-Level Code
of the Multiplier
Verilog Digital System Design
Z. Navabi, 2006 21
Control Data Partitioning
Sequential
Multiplier Design
Datapath Multiplier
Description Controller
Top-Level Code
of the Multiplier
Verilog Digital System Design
Z. Navabi, 2006 22
Control Data Partitioning
Data part consists of
registers, logic units, and
their interconnecting buses.
lsb_out
msb_out
Datapath
databus clr_P
done
load_P
8 load_B
msb_out
lsb_out
sel_sum
load_A
shift_A
A0
start
Datapath Multiplier
Description Controller
Top-Level Code
of the Multiplier
Verilog Digital System Design
Z. Navabi, 2006 24
Selects carry-out from
Multiplexer
data
B sum
load_B
clk
clr_P
ShiftAdd
P A
load_P
8-bit Registers
A0
load_A
shift_A
msb_out 8-bit Shift Register
ShiftAdd[0]
lsb_out
Tri-state Buffers
Multiplier Block Diagram
Verilog Digital System Design
Z. Navabi, 2006 25
Datapath Description
Sequential
Multiplier Design
Datapath Multiplier
Description Controller
Top-Level Code
of the Multiplier
Verilog Digital System Design
Z. Navabi, 2006 26
Datapath Description
module datapath ( input clk, clr_P, load_P,
load_B, msb_out, lsb_out,
sel_sum, load_A, shift_A,
inout [7:0] data, output A0 );
...............................
...............................
...............................
Multiplexer for
assign A0 = A[0];
selection of sum or P
Datapath Multiplier
Description Controller
Top-Level Code
of the Multiplier
Verilog Digital System Design
Z. Navabi, 2006 30
Datapath Description
The multiplier
The multiplier waits forcontroller
`define idle 4'b0000 is a loading
start while finite state
A machine
`define init 4'b0001 that has 2 starting states,
Multiplier loads B
`define m1 4'b0010 8 multiplication states,
`define m2 4'b0011 and 2 ending states.
`define m3 4'b0100 The multiplier performs
`define m4 4'b0101 add-and-shift of P+B, or
`define m5 4'b0110 P+0, depending on A0
`define m6 4'b0111
States and
`define m7 4'b1000
their binary assignments
`define m8 4'b1001
The 2 halves of the result
`define rslt1 4'b1010
are put on databus.
`define rslt2 4'b1011
...............................
`m1, `m2, `m3, `m4, `m5, `m6, `m6, `m7, `m8:
begin
current <= current + 1;
Shifting A Shift_A = 1; load_P = 1; Loading P
if (A0) sel_sum = 1;
Asserting sel_sum
end
...............................
Datapath Multiplier
Description Controller
Top-Level
Top-Level Code
of the Multiplier
of the Multiplier
Verilog Digital System Design
Z. Navabi, 2006 36
Top-Level Code of the Multiplier
module Multiplier ( input clk, start,
inout [7:0] databus,
output lsb_out, msb_out, done );
wire clr_P, load_P, load_B, msb_out, lsb_out,
sel_sum, load_A, Shift_A;
Sequential
Multiplier
Shift-and-add Sequential
Multiplier
Multiplication Multiplier
Testing
Testing
Process Design
Reading Applying
Data Files Start
Calculating Reading
Expected Result Multiplier Output
Comparing
Results
Verilog Digital System Design
Z. Navabi, 2006 41