Question

A sequential circuit has one input (X), a clock input (CLK), and two outputs (S and V). X, S and V are all one-bit signals. X represents a 4-bit binary number N, which is input least significant bit first. S represents a 4-bit binary number equal to N + 3, which is output least significant bit first. At the time the fourth input occurs, V = 1 if N + 3 is too large to be represented by 4 bits; otherwise, V = 0. The value of S should be the proper value, not a don’t care, in both cases. The circuit always resets after the fourth bit of X is received. For simplicity, assume the sequential circuit is implemented with the following state table. The outputs are (S,V). All state changes occur on the falling edge of the clock pulse. For simplicity, you can just follow the following table for your code.

Present State Next State Next State Output Output
X=0 X=1 x=0 x=1
S0 S1 S2 1,0 0,0
S1 S3 S4 1,0 0,0
S2 S4 S4 0,0 1,0
S3 S5 S5 0,0 1,0
S4 S5 S6 1,0 0,0
S5 S0 S0 0,0 1,0
S6 S0 S0 1,0 0,1

Write A Verilog Description using the State Table Shown Above.The following code should be helpful guide to your lab (You need to make modifications, this code is for illustration purpose only) 6. module controllerl (x,clk, rstn,y,z); input x; input clk; input rstn; output y; output Z; parameter S03h0, S1 -3hl, S23h2, S3 3h3, S4 3h4; reg [2:0] PRState, NXState reg y; assign Zy: always e (PRState) begin if (PRState-S4) y else y 1b0; 1b1; end always (posedge clk or negedge rstn) begin if (rstn1b0) PRState SO; else PRStateNXState; end always (PRState or x) begin case (PRState) else NXS tate = S0; else NXS tate = S1; else NXState = S2; else NXState-S3; S4: NXState-S4; endcase endmodule

0 0
Add a comment Improve this question Transcribed image text
Answer #1

I've write down the the VLSI code in notepad as right now I don't have the software, you can check the code if its is correct, I think it will work.

File Edit Format View Help module state_machine(clk,rst,X,S,v); output s,V; input X; input clk,rst; reg S,V reg[1:0] state; parameter s0-3de, s1-3 d1,s2-3 d2, s3-3 d3, s4-3d4,s5-3d5, s6-3d6; alwayas @(negedge clk or negedge rst) if (rst--0) begin state-s0; S-0V-0; end else begin case(state) s0:if (X-0) begin state-s1;5-1;V-0; end else begin state s2;S-0;V-0; end s1:if(X-0) begin state-s3;S-1;V-0; end

Add a comment
Know the answer?
Add Answer to:
A sequential circuit has one input (X), a clock input (CLK), and two outputs (S and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Suppose a sequential logic circuit has an input X and a clock input CLK. The outputs...

    Suppose a sequential logic circuit has an input X and a clock input CLK. The outputs are Qi,Qo, and Y, and the next state table is as shown below Q00 X-0 X=1 01 10 01 10 0 0 0 a) Is this a Moore circuit or Mealy circuit? b) What does this cireuit do when the input X - c) What does this circuit do when the input X 1? d) Suppose the initial values of the state are QiQ...

  • A sequential circuit has one input (X), and two outputs (S and V). X represents a...

    A sequential circuit has one input (X), and two outputs (S and V). X represents a 4-bit binary number N, which is input least significant bit first. S represents a 4-bit binary number equal to N+2, which is output least significant bit first. At the time the fourth input occurs, V=1 if N+2 is too large to be represented by 4 bits; otherwise V=0. The value of S should be the proper value, not a don’t care, in both cases....

  • Given the following verilog code, draw the corresponding state diagram for it. module mysterious (input reset,...

    Given the following verilog code, draw the corresponding state diagram for it. module mysterious (input reset, clk, TB, TA, output reg [1:0] LB, LA); reg [1:0] cstate, nstate; parameter S0 = 2'b00; parameter S1 = 2'b01; parameter S2 = 2'b10; parameter S3 = 2'b11; parameter grn = 2'b00; parameter ylw = 2'b01; parameter rd = 2'b10; // state register always @ (posedge clk, posedge reset) begin if (reset) cstate <= S0; else cstate <= nstate; end // next state logic...

  • Consider the following code, and write the sequence of statements (Si) that will be executed for...

    Consider the following code, and write the sequence of statements (Si) that will be executed for the values of (x,y) = (0,0), (0,1), (1,0), (1,1), (-1,-1) S1 if x==0 and y==0: S2 elif x>0 and y>0: S3 elif x>0 or y>0: S4 else: S5 S6

  • I need help writing a test bench for the following Verilog code module CU(IE, WE, WA,...

    I need help writing a test bench for the following Verilog code module CU(IE, WE, WA, RAE, RAA, RBE, RBA, ALU,                SH, OE, start, clk, reset, Ng5); //nG5 denotes (N>5);    input start, clk, reset;    output IE, WE, RAE, RBE, OE;    output [1:0] WA, RAA, RBA, SH;    output [2:0] ALU;       input wire Ng5;    reg [1:0] state;    reg [1:0] nextstate;    parameter S0 = 3'b000;    parameter S1 = 3'b001;...

  • 2 Design a circuit that has two inputs, clk and X, and produces one output O....

    2 Design a circuit that has two inputs, clk and X, and produces one output O. Xmay change every clock cycle and the change happens at the falling edge. The circuit samples the input at every rising edge of the clock. O is 1 (for one clock cycle, from positive edge to positive edge) if the last values of X over the last three cycles were 101. (a) Complete the following the state transition diagram for this circuit. Assume that...

  • The sequential circuit shown below has two flip-flops A and B and one input x. It...

    The sequential circuit shown below has two flip-flops A and B and one input x. It consists of a combinatorial logic connected to the flip-flops, as shown in the Figure 1. Below. Analyze the sequential circuit below: A J A' K Q lo B 2-to-1 MUX Y J Q 11 S B K CLK Figure 1a. Sequential Circuit a) Derive the next state equations for the sequential circuit above: find expressions for JA and KA and Jb and KB as...

  • A sequential circuit has two D flip-flops, A and B, one input x and one output...

    A sequential circuit has two D flip-flops, A and B, one input x and one output y. The flip-flop input functions and the output function are the folllowing: DA = Ax` + Bx DB= A`x + Bx` y = Ax + Bx a) Write the state table of the circuit b) Draw the state diagram of the circuit (note that the output changes when the input changes)

  • A sequential circuit is to be designed with two input lines A - "Pres> 800" and...

    A sequential circuit is to be designed with two input lines A - "Pres> 800" and B Temp> 100" and a single outputX-"ALARM". If a clock pulse arrives when AB 00 the circuit is to assume a reset state which may be labeled SO. Suppose the next "3" clock pulses following a resetting pulse coincide with thoe following sequence of input conditions 01- 11 - 01 The output"ALARM" is to be"1" coinciding with the third of such a string of...

  • A sequential circuit with two flip flops, A and B; one input, x; and one output...

    A sequential circuit with two flip flops, A and B; one input, x; and one output y, is specified  by the following next-state and output equations: B(t+1) = AX A(t+1) = A’B + BX’ + AB’X y = A’X’ + B’ a)      List the circuit state table and draw the corresponding state diagram b)      Draw the logic diagram of the circuit using only, one D-type and one T-type flip flops, one 2X4 decoder and one 2-input OR gate. The complement of the input...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT