Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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

ID: 3860477 • Letter: D

Question

Design a circuit that has two inputs, clk and X, and produces one output O. X may 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 S0 is the starting state. Label each arc as X = 1 or X = 0 to indicate if the change of state occurs when X is 1 or 0, respectively. Within each state write O = 1 or O = 0 to indicate the output. (b) Complete the following Verilog module for this circuit, where the portions with"_________" are to be replaced with appropriate Verilog code, which are the next state functions (S1 and S0) and the output function (O). Minimize the logic required for these assignments. You will have to derive these functions. module HW8P2 (clk, X, O): input clk, X: output O: wire S1, S0, Q1, 90, Q1bar, Q0bar: assign S1 = _________: Dff1 C1 (S1, clk, Ql, Q1bar): assign S0 = __________: Dff1 C0 (S0, clk, Q0, Q0bar): assign O = __________: endmodule

Explanation / Answer

L0:add $0, $1, $2

sub $3, $3, $1

lw $3, 12($0)

beq $3, $0, L1

add $3, $3, $1

sw $3, 0($3)

L1:beq $0, $0, L0

Opcode -- add: 000000, sub: 000000, lw: 100011, sw: 101011, beq: 000100

Funct -- add: 100000, sub: 100010

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote