Analyse Verilog code in Figure 1 and modify the code to fulfil the following conditions: a) Add two more states: state C with state code 10, and state D with state code 11. b) State C will transit to state D if input X is 0 (output Z is 0), but it will remain in state C if input X is 1 (output Z is 0). c) State D will transit to state A if input X is 0 (output Z is 0), and it will transit to state B if input X is 1 (output Z is 1).

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
100%

Analyse Verilog code in Figure 1 and modify the code to fulfil the following conditions:
a) Add two more states: state C with state code 10, and state D with state code 11.
b) State C will transit to state D if input X is 0 (output Z is 0), but it will remain in state
C if input X is 1 (output Z is 0).
c) State D will transit to state A if input X is 0 (output Z is 0), and it will transit to state
B if input X is 1 (output Z is 1).

2. Simulate the modified code by using input values shown in Figure 2. Verify your
waveform by referring to the outputs in the figure.
40.0 ns
80.0 ns
120,0 ns
160,0 ns
200,0 ns
240.0 ns
ps
280.0 ns
320.0 ns
Name
O ps
CLK
RESET
in
ut
> present_state
00
01
00
01
10
11
01
00
01
10
aut
> next_state
00
01
00
01
10
11
01
00
01
00
01
10
11
out
Figure 2
3. Next, record a short video (3-5 minutes) to explain all the steps involved in getting correct
waveform for the modified code. The steps should start with Open Project and ends with
correct simulated waveform. Please also explain your observation on the output waveform.
4. Lastly, write a report to discuss modifications that you have performed to the Verilog code
in Figure 1 and your findings from the simulated waveform. Therefore, your report must
include all the following:
a) Verilog code that has been modified.
b) State diagram of the Verilog code.
c) State table of the Verilog code.
d) Discussion on the type of FSM machine used for the Verilog code, and your results
obtained from the simulated waveform. Please include your simulated waveform in
the report.
e) Detail discussion on your observation for time frame 230.0ns until 310.0ns in Figure
2.
5. Please submit your report in PDF and save as the file using the following file name format:
FullName_MatricNumber.pdf
Transcribed Image Text:2. Simulate the modified code by using input values shown in Figure 2. Verify your waveform by referring to the outputs in the figure. 40.0 ns 80.0 ns 120,0 ns 160,0 ns 200,0 ns 240.0 ns ps 280.0 ns 320.0 ns Name O ps CLK RESET in ut > present_state 00 01 00 01 10 11 01 00 01 10 aut > next_state 00 01 00 01 10 11 01 00 01 00 01 10 11 out Figure 2 3. Next, record a short video (3-5 minutes) to explain all the steps involved in getting correct waveform for the modified code. The steps should start with Open Project and ends with correct simulated waveform. Please also explain your observation on the output waveform. 4. Lastly, write a report to discuss modifications that you have performed to the Verilog code in Figure 1 and your findings from the simulated waveform. Therefore, your report must include all the following: a) Verilog code that has been modified. b) State diagram of the Verilog code. c) State table of the Verilog code. d) Discussion on the type of FSM machine used for the Verilog code, and your results obtained from the simulated waveform. Please include your simulated waveform in the report. e) Detail discussion on your observation for time frame 230.0ns until 310.0ns in Figure 2. 5. Please submit your report in PDF and save as the file using the following file name format: FullName_MatricNumber.pdf
Emodule state_machine (CLK, RESET, X, z,
L
1
present_state, next_state);
3
input CLK, RESET, X;
4
output z;
output present_state, next_state;
6.
reg present_state, next_state;
parameter A = l'b0, B = l'bl;
7
8.
reg 2;
always @ (posedge CLK or posedge RESET)
Abegin
if (RESET)
10
11
12
13
present_state <= A;
14
else
15
present_state <= next_state;
16
end
17
always e (X or present_state)
Abegin
18
19
case (present_state)
A: next state = X ? B : A;
B: next_state = X ? A : C;
20
21
22
23
endcase
24
end
25
always e (X or present_state)
Abegin
26
27
case (present state)
A: z = 1'b0;
B: z - 1'b0;
28
29
30
31
endcase
32
end
33
endmodule
Figure 1
Transcribed Image Text:Emodule state_machine (CLK, RESET, X, z, L 1 present_state, next_state); 3 input CLK, RESET, X; 4 output z; output present_state, next_state; 6. reg present_state, next_state; parameter A = l'b0, B = l'bl; 7 8. reg 2; always @ (posedge CLK or posedge RESET) Abegin if (RESET) 10 11 12 13 present_state <= A; 14 else 15 present_state <= next_state; 16 end 17 always e (X or present_state) Abegin 18 19 case (present_state) A: next state = X ? B : A; B: next_state = X ? A : C; 20 21 22 23 endcase 24 end 25 always e (X or present_state) Abegin 26 27 case (present state) A: z = 1'b0; B: z - 1'b0; 28 29 30 31 endcase 32 end 33 endmodule Figure 1
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY