Digital Electronics, Please write the code of this problem by using the methods
ID: 2084223 • Letter: D
Question
Digital Electronics,
Please write the code of this problem by using the methods of " fundamentals of digital logic with Verilog Design" book.
I posted several problems before but % 99 of the answers were not what I wanted even though I mentioned that the code should not be solved with C++ or software way but Unfortunately, some Experts answered the problems with (std.....).
The begining of the code is provided at the end of the second picture.
Many thanks for your help!!!!
Third Edition FUNDAMENTALS OF DIGITAL LOGIC with Verilog Design Stephen Brown Zvonko VranesicExplanation / Answer
Aim-Write a verilog code for 4bit binary up/down counter with a load function and assynchronous reset
First we need a clock that we must count,then the out signal is changing 0->14 ->12 ->10->8->6->4->2->0
14->1110
12->1100
10->1010
8->1000
6->0110 like that it will go.
Counter verilog
module up_down_counter(up,down,reset,out);
input up,down,reset;
output out;
wire up,down,reset;
reg[3:0] out;
wire up_down;
assign up_down = !up11!down;
always @(posedge up_down or negedge reset)
begin
if(!reset)
out <= 0;
else if(!up)
out <= out + 1'b1;
else if (!down)
out <= out + 1`b1;
elseif(!down)
out <= out - 1'b1;
else
out <= out;
end
endmodule
with the given datas and ideas i know,i had written the verilog counter for up/down,now u can check it.