(2) If we want to design a 8-bit Up-Down counter which can counter from 0 to 255. This counter can increase countering when the control signal of Up-Down is high, and decrease countering when Up-Down is low. Now please fill the blanks to complete the design based on the Verilog code in Fig 2(a).

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
2. Design of a 4-bit excess-3 counter and 8-bit Up-Down counter.
(1) Fig 2 shows the logic symbol of an universal 4-bit counter, its truth table and Verilog code. Nov
please design the Verilog code of a 4-bit excess-3 counter (counter from 3 to 12) based on the cod
in Fig 2(a). Please fill the blanks to complete the design.
CLOCK
CNTR4U
CLK
CLR
LD
ENP
11
ENT
DO
D1
D2
D3
778588
88888
QO
Q1
-Q2
-Q3
RCO
CLR
1
0
0
0
0
0
0
0
0
Inputs
LD ENT ENP
1
0
0
0
0
X
0
X
X 0
1
X
X
1
1 1
0
1
0
1
0 1
1
1
1
Current State
Q3 Q2 Q1 QO
Fig 2
X
X
X
X X
X
X X
0
0
0
0 0 0
1 1
1
X
module Vrcntr4u( CLK, CLR, LD, ENP, ENT, D, Q, RCO );
input CLK, CLR, LD, ENP, ENT;
input [3:0] D;
output reg [3:0] Q;
output reg RCO;
0
1
1
1
0
1 1 1 1
X
Q <= 4'd0;
Q <= D;
X
0
1
always (posedge CLK) // Create the counter f-f behavior
if (CLR == 1)
else if (LD == 1)
else if ((ENT-1) && (ENP-1)) Q <- Q + 1;
else
Q <= Q;
Q3*
0
D3
Q3
Q3
always (Q or ENT)
// Create RCO combinational output
if ((ENT == 1) && (Q == 4'd15))
else
RCD = 1;
RCD = 0;
endmodule
0
0
1
0
Next State
Q2* Q1 QO
0
0
0
D2
D1
DO
Q2
Q1
Q2
Q1
0
1
0
0
1
1
0
-10
888
QO
1
0
0
1
0
Transcribed Image Text:2. Design of a 4-bit excess-3 counter and 8-bit Up-Down counter. (1) Fig 2 shows the logic symbol of an universal 4-bit counter, its truth table and Verilog code. Nov please design the Verilog code of a 4-bit excess-3 counter (counter from 3 to 12) based on the cod in Fig 2(a). Please fill the blanks to complete the design. CLOCK CNTR4U CLK CLR LD ENP 11 ENT DO D1 D2 D3 778588 88888 QO Q1 -Q2 -Q3 RCO CLR 1 0 0 0 0 0 0 0 0 Inputs LD ENT ENP 1 0 0 0 0 X 0 X X 0 1 X X 1 1 1 0 1 0 1 0 1 1 1 1 Current State Q3 Q2 Q1 QO Fig 2 X X X X X X X X 0 0 0 0 0 0 1 1 1 X module Vrcntr4u( CLK, CLR, LD, ENP, ENT, D, Q, RCO ); input CLK, CLR, LD, ENP, ENT; input [3:0] D; output reg [3:0] Q; output reg RCO; 0 1 1 1 0 1 1 1 1 X Q <= 4'd0; Q <= D; X 0 1 always (posedge CLK) // Create the counter f-f behavior if (CLR == 1) else if (LD == 1) else if ((ENT-1) && (ENP-1)) Q <- Q + 1; else Q <= Q; Q3* 0 D3 Q3 Q3 always (Q or ENT) // Create RCO combinational output if ((ENT == 1) && (Q == 4'd15)) else RCD = 1; RCD = 0; endmodule 0 0 1 0 Next State Q2* Q1 QO 0 0 0 D2 D1 DO Q2 Q1 Q2 Q1 0 1 0 0 1 1 0 -10 888 QO 1 0 0 1 0
module Vrexcess3 (CLK, CLR, LD, ENP, ENT, D, Q, RCO);
input CLK, CLR, LD, ENP, ENT;
input [3:0] D;
output reg [3:0] Q:
output reg RCO;
always @ (posedge CLK)
if (CLR-1)
else if( LD-1).
else if (ENT && ENP && (
else if (ENT && ENP)
else Q<-Q;
always @(Q or ENT)
if (ENT && (
else
endmodule
(2) If we want to design a 8-bit Up-Down counter which can counter from 0 to 255. This counter
can increase countering when the control signal of Up-Down is high, and decrease countering when
Up-Down is low. Now please fill the blanks to complete the design based on the Verilog code in
Fig 2(a).
module VrUpDown_8b (CLK, CLR, LD, ENP, ENT, Up-Down, D, Q, RCO);
input
input
output reg
output reg.
always @ (posedge CLK)
if (CLR=1)
else if( LD == 1)
else if (ENT && ENP && (
else if (ENT && ENP && (
else Q<-Q;
always @(Q or ENT or Up-Down)
if (
else if (
else
endmodule
Transcribed Image Text:module Vrexcess3 (CLK, CLR, LD, ENP, ENT, D, Q, RCO); input CLK, CLR, LD, ENP, ENT; input [3:0] D; output reg [3:0] Q: output reg RCO; always @ (posedge CLK) if (CLR-1) else if( LD-1). else if (ENT && ENP && ( else if (ENT && ENP) else Q<-Q; always @(Q or ENT) if (ENT && ( else endmodule (2) If we want to design a 8-bit Up-Down counter which can counter from 0 to 255. This counter can increase countering when the control signal of Up-Down is high, and decrease countering when Up-Down is low. Now please fill the blanks to complete the design based on the Verilog code in Fig 2(a). module VrUpDown_8b (CLK, CLR, LD, ENP, ENT, Up-Down, D, Q, RCO); input input output reg output reg. always @ (posedge CLK) if (CLR=1) else if( LD == 1) else if (ENT && ENP && ( else if (ENT && ENP && ( else Q<-Q; always @(Q or ENT or Up-Down) if ( else if ( else endmodule
Expert Solution
steps

Step by step

Solved in 4 steps

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