Highlights
1) 4% The following code describes an 8 bit ___NAND___ Gate:
input [7:0] A;
output Z;
assign Z = (A != 255);
2) 6% Consider the following code, describe 3 critical issues with it, or rules broken.
input In;
output Out;
reg[1:0] State, Next;
reg A;
wire D;
always @(*) begin
case(State)
0: Next = In?1:0;
1: Next = In?2:0;
2: Next = In?1:1;
Endcase
D <= In && A;
A = D ^ In;
end
always @(posedge Clk) begin
State <= Next;
if (State != 1) A <= In; Out <= 0;
end
Any statement before = or <= in an always block should be defined reg type,
D <= In && A; will cause a syntax error because it is a wire type.Wire types are used in assign statements so the following lines of code are all written in correctly:
wire D; //has to be changed to reg D;
D <= In && A;
D has to be a reg type to be in an always block, wire is used in continuous statements.
Second syntax error Endcase is endcase not Endcase, Verilog is case sensitive.
Clk is not declared anywhere.
There is no module name declaring the input and output ports.
if (State != 1) A <= In; Out <= 0; //Procedural assignment error, Out has to be a reg type to be in a procedural assignment. Have to declare: output reg Out;
3) 20% Finish writing the Verilog code for an 8-bit Encoder. In is an 8-bit value, when New is true, Out should be the LSB of In. Then on the next posedge Clk, output should be the second LSB of In. After the MSB is output, Out should become zero and stay that way until the next New = true.
module Encode8(Clk, In, New, Out);
input Clk;
input[7:0] In;
input New;
output Out;
reg[2:0] bit;
end module
4) 25% Absolute Summer; Write a Verilog module that has inputs Clk, Clr, and In; with outputs Sum and Saturated. In is an 8-bit signed value, each cycle the absolute value of In is added to Sum (an 8-bit unsigned value). When Clr is true, Sum is set to the absolute value of In. If Sum >= 255, Sum = 255 and Saturated is true. You must use a premade 8-bit full adder module full8add (a, b, c_in, c_out, sum), do not use ‘+’.
This Computer Science Assignment has been solved by our Computer Science Experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.
Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.
© Copyright 2026 My Uni Papers – Student Hustle Made Hassle Free. All rights reserved.