AT&T; LTE 9:49 AM please answer all parts and show all work You are the head of
ID: 3586214 • Letter: A
Question
AT&T; LTE 9:49 AM please answer all parts and show all work You are the head of a design team. Two colleagues have submitted their Verilog code designed to implement the circuit in Fig.1.Code A is an attempt at a behavioral implementation, and Code B is an attempt at a structural implementation. Your job is to determine which of the two codes should be used and justify your decision. Note: Your answer should be based on analysis of the code. Your answer should not be "Behavioral is better than structural, so I pick Code A." Code A //2x4 Decoder module Decoder24 output wire W, output wire X, output wire Y, output wire Z input wire [1:0] S, Code B //2x4 Decoder module Decoder24 output wire W, output wire X, output wire Y, output wire Z, input wire SO input wire S1, always@(*) case(S) assign w =-SI & ~SO; assign XSI & SO; assign Y = Si & ~S0: assign Z-S1 & SO endmodule 0: w=1; 2: Y-1 3: Z-1: default: w=1; endcase endmoduleExplanation / Answer
Solution:
As code A has defined outputs as wire so,
We cannot assign some values to these variables w,x,y,z in the always block.
So, If we go with code A we will error.
Hence, We go for code B
Code B
//2x4 Decoder
module Decoder24 (
output wire W,
output wire X,
output wire Y,
output wire Z,
input wire S0,
input wire S1,
);
assign W= ~S1 & ~S0;
assign X= ~S1 & S0;
assign Y= S1 & ~S0;
assign Z= S1 & S0;
endmodule
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.