I have tried to answer the question using Verilog code. Hope it helps.
Feel free to ask if you have any querry..!!
Code for one grey cell -
module block( clk,rst ,x,y,q,r);
input clk,rst,x,y;
output reg q;
output r;
wire d;
always @ (posedge clk or posedge rst)
begin
if (rst)
q =0;
else
begin
q = d;
end
end
assign r = x && y;
assign d = (q && (~r)) || ((~q) && r);
endmodule
Code for combined module having three grey cells instantiated and connected as per the figure -
Note - Here I have used one more output naming "out" which shows the count together using three
module top( clk,rst,q0,q1,q2,out);
input clk, rst;
output q0,q1,q2;
output [2:0]out;
wire r1,r2,r3;
block b1( clk,rst ,1'b1,1'b1,q0,r1);
block b2( clk,rst ,r1,q0,q1,r2);
block b3( clk,rst ,r2,q1,q2,r3);
assign out = {q2,q1,q0};
endmodule
Test bench to check the above codes-
module top_tb;
reg clk,rst;
wire q0,q1,q2;
wire [2:0] out;
top t1( clk,rst,q0,q1,q2,out);
always
begin
clk =1; #5;
clk =0; #5;
end
initial
begin
rst =1;
#1;
rst =0;
end
endmodule
Here are the simulation results-
![οττ τοτ οοτ ττο οτο του 200 τττοττ τοτ οοτ ττοοτο του και [ot]gno & Η 75 ML το ML 8 το και su 00TL su os andΡΛ. awen](http://img.homeworklib.com/questions/e435ff20-c509-11ea-916a-29464d14fbe9.png?x-oss-process=image/resize,w_560)
Q3. Synchronous Counter Figure 8.3(a) shows a modulo-8 synchronous up-counter (Modulo-8 because this counter can count...
Design serial (asynchronous) counter modulo 7 using synchronous flip-flops (T, D or JK). The counter should count up.
[41 140 points En Reset Clock Analyze the clocked synchronous Modulo-8 Binary Counter [zyx] shown. The counter is initially reset at startup. Show the characteristic and excitation equations of the Enabled T Flip-Flops, as well the state-transition table. Draw the state diagram of the counter.
[41 140 points En Reset Clock Analyze the clocked synchronous Modulo-8 Binary Counter [zyx] shown. The counter is initially reset at startup. Show the characteristic and excitation equations of the Enabled T Flip-Flops, as well...
Design C-1 (modulo-10 up-counter): Using the behavioral VHDL coding, create an up-counter to count upward. The up counter has the following control inputs En.reset, CLK. The counting outputs are Q0, O1, Q2. and O3 reset clears the outputs of the counter to 0. En enables the counting when En-1. When En-0, the counter stops. The counter sequentially counts all the possible numbers and loops again, from 0 to 9, back to 0 and 9, etc Design C-2: Ten-second Counter with...
Consider the circuit in Figure 1. It is a 4-bit (QQ2Q3) synchronous counter which uses four T-type flip-flops. The counter increases its value on each positive edge of the clock if the Enable signal is asserted. The counter is reset to 0 by setting the Clear signal low. You are to implement an 8-bit counter of this type Enable T Q Clock Clear Figure 1. 4-bit synchronous counter (but you need to implement 8-bit counter in this lab) Specific notes:...
Use a behavioral Verilog model to design a 3-bit fault tolerant up-down counter. For each flip-flop (FF) include asynchronous reset and preset signals. Refer to Example 4.3 on page 160 for an example of a single FF with both reset and preset signals as well as with an enable signal. For this project, you don't need to use FFs with enables. You don't also need not-q (nq) in this assignment. Use active-high signals for reset and present signals. The example...