Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 14bc842

Browse files
committed
Build a circuit from a simulation waveform solved
1 parent e2f60c3 commit 14bc842

File tree

9 files changed

+61
-0
lines changed

9 files changed

+61
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module top_module (
2+
input a,
3+
input b,
4+
input c,
5+
input d,
6+
output q );//
7+
8+
assign q = (a | b) & (c | d); //
9+
10+
endmodule
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module top_module (
2+
input clk,
3+
input a,
4+
output q );
5+
6+
always @(posedge clk)
7+
q <= ~a;
8+
9+
endmodule

‎4-Verification-Reading Simulations/17-Build a circuit from a simulation waveform/170-Sequential-circuit7.v‎

Whitespace-only changes.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module top_module (
2+
input clock,
3+
input a,
4+
output p,
5+
output q );
6+
7+
always @(*)
8+
if(clock)
9+
p = a;
10+
11+
always @(negedge clock)
12+
q <= a;
13+
14+
endmodule

‎4-Verification-Reading Simulations/17-Build a circuit from a simulation waveform/171-Sequential-circuit8.v‎

Whitespace-only changes.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module top_module (
2+
input clk,
3+
input a,
4+
output [3:0] q );
5+
6+
always @(posedge clk) begin
7+
if(a)
8+
q <= 4;
9+
else if( q == 6)
10+
q <= 0;
11+
else
12+
q <= q + 1;
13+
end
14+
15+
endmodule

‎4-Verification-Reading Simulations/17-Build a circuit from a simulation waveform/172-Sequential-circuit9.v‎

Whitespace-only changes.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module top_module (
2+
input clk,
3+
input a,
4+
input b,
5+
output q,
6+
output state );
7+
8+
assign q = a ^ b ^ state;
9+
always @(posedge clk) begin
10+
state <= a & b | b & state | a & state ;
11+
end
12+
13+
endmodule

‎4-Verification-Reading Simulations/17-Build a circuit from a simulation waveform/173-Sequential-circuit10.v‎

Whitespace-only changes.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /