10 Continuous Assign v8
10 Continuous Assign v8
Modeling
Behavioral f
RTL
AND_
OR
Data Flow
and Gate
Switch
rise
1
0,x,z
1,x,z
fall
0
IN_1
IN_2
OUT
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Simulation Time
wire # 5 OUT1;
. . . A
assign OUT1 = A & B ; OUT1
B
alternatively
5 ns
wire # 5 OUT1 = A & B ;
or
wire OUT1 ;
assign # 5 OUT1 = A & B ;
Q0
DFF
Clk 0
Rst
N1 Q1
DFF1
Clk
assign N1 = ( Q[0] ^ Q[1] ) ; Rst
N2 Q2
DFF2
Clk
assign N2 = ( Q[2] ^ (Q[0] & Q[1])) ; Rst
– wire CS;
– reg RD, WR;
– assign #2 CS = ADDR[10] & ADDR[9] & ~ADDR[8] & ~ADDR[7];
– always @ ( posedge CLK )
– begin
– RD <= #2 ADDR[11] & CS;
– WR <= #2 ~ADDR[11] & CS;
– end
FYI: Any gate-level model can be synthesized, but the actual gates used
depend on the available primitives and macros in the target technology
library
and nand
or nor
xor xnor
buf not
bufif0 notif0
FYI: Should be coded for mutual exclusivity; for example, ensuring that only
one driver is enabled at a time
and A1 ( SIG1, A, B ) ;
and A2 ( SIG2, C, D ) ;
or O1 ( Z, SIG1, SIG2 ) ;
....
endmodule
A SIG1
Gate output B
Z
must be listed first! C
D SIG2
bufif0
IN_1 OUT_1
CTRL