Question

Analyze the following Verilog code and write down its output as pictured in the code. module...

Analyze the following Verilog code and write down its output as pictured in the code.
module blocking;
reg [0:7] A, B;
initial begin: init1
A = 3;
#1 A = A + 1; // blocking procedural assignment
B = A + 1;
$display("Output 1: A= %b B= %b", A, B );
A = 1;
#1 A <= A + 1;
B <= A + 1;
#1 $display ("Output 2: A= %b B= %b", A, B );
end
endmodul

Homework Answers

Answer #1

Dear student hope this solution helps you. Please don't forget to give thumbs up thank you

Know the answer?
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
Similar Questions
Problem 4 - 5 Pts] Verilog [Part 4.1 - 5 Pts] What does the Verilog code...
Problem 4 - 5 Pts] Verilog [Part 4.1 - 5 Pts] What does the Verilog code below do? Provide as much detail as possible and provide informative descriptions/labels for the 4 input/outputs. module mystery (W, X, Y, Z); input W, X, Y; output Z; reg [7:0] P; always @ (posedge W or posedge X) begin if (X) P = 8'b00000000; else P = {P[6:0], Y); end assign Z = P[7]; endmodule
Using the programing language of Verilog I attempted to make a counter to count from 0...
Using the programing language of Verilog I attempted to make a counter to count from 0 to 9 then loop back to 0 using the internal clock of the FPGA cyclone IV from altera. the code is posted at the bottom counts from 0 to 1 then loop back to 0 instead of counting up to 9. Can someone help me spot the error so it can count up to 9 module Encryption(SW, CLOCK_50, OUT, HEX0); input[1:0]SW; input CLOCK_50; output...
Design a module that can perform a binary-coded decimal (BCD) addition. You have two 4-bit BCD...
Design a module that can perform a binary-coded decimal (BCD) addition. You have two 4-bit BCD (decimal digits 0 to 9) inputs “a” and “b” and an 8-bit output “x” which represents a two digit BCD number. X [7:4] represents the upper BCD digits X [3:0] represents the lower BCD digits In the Verilog file, please code a BCD adder. It should follow the following format. module bcd_adder( a,b,x ); input wire [3:0] a; input wire [3:0] b; output reg...
Use case statement to implement an 8:1 mutiplexer Verilog HDL module called mux8 with inputs s[2:0],...
Use case statement to implement an 8:1 mutiplexer Verilog HDL module called mux8 with inputs s[2:0], D[7:0] and output Y. write a testbench for the function.
(ii) Create a hierarchical Verilog 5-to-1 mux module with five data inputs (a, b, c, d,...
(ii) Create a hierarchical Verilog 5-to-1 mux module with five data inputs (a, b, c, d, e), three select inputs (s[2:0]), and one output bit (f) using 4-to-1 multiplexers. Design the 4-to-1 multiplexer using behavioral code.
How do I design a divide by 4 clock in verilog using 2 D Flip Flop...
How do I design a divide by 4 clock in verilog using 2 D Flip Flop blocks? I have created this divide by 2 clock D Flip Flop block so far: module divide_by_2(D, Clk,reset, Q, Qnext); //Divide by 2 clock with reset using D flip flop    input Clk, D, reset;    output Q,Qnext;    reg Q;       assign Qnext = ~Q;       always @(posedge Clk or posedge reset) //always at the positive edge of the clock or...
1.) 2-bit binary numbers represent the values 0..3 with the following encoding: Encoding [1:0] Value 0...
1.) 2-bit binary numbers represent the values 0..3 with the following encoding: Encoding [1:0] Value 0 0 0 0 1 1 1 0 2 1 1 3 Develop the simplest Sum-of-Products equation possible that, when given two 2-bit binary numbers X[1:0] and Y[1:0], will output whether the value of X is greater than the value of Y. 2.) Assume that we have already implemented the solution to problem #1 as a module “isGreater(F, X, Y)” in Verilog, and cannot change...
using matlab please present code for the following (ALL PARTS PLEASE AND THANK YOU) 1. No...
using matlab please present code for the following (ALL PARTS PLEASE AND THANK YOU) 1. No Input/No Output Write a function that has no input and no outputs. This function will simply display some text when it is called. (this is my code, are there suggestions for improvements?) function Display() disp('some text') end 2. 1 Input/No Outputs Write a function with one input and no outputs. This function will simply display a variable that is provided as an input argument....
Convert the following code using variables rather than signals. Comment on the differences of a code...
Convert the following code using variables rather than signals. Comment on the differences of a code that uses only signals to a code which makes use of variables. entity converter is port( sign_mag : in std_logic_vector(3 downto 0) ; twos_comp : out std_logic_vector(3 downto 0) ); end converter; architecture converter_arch of converter is signal neg : std_logic_vector(3 downto 0); begin process(sign_mag) begin if (sign_mag <= 1000) then twos_comp<=sign_mag; else neg <=('1' & not sign_mag(2 downto 0))+1; twos_comp<=neg; end if;
APPLIED STATISTICS 2 USE R CODE ! SHOW R CODE! Write a function to calculate the...
APPLIED STATISTICS 2 USE R CODE ! SHOW R CODE! Write a function to calculate the sum of cubes from 1 to n, but skip the multiple of 5. Say, if n=10, the result is 1^3+2^3+3^3+4^3+6^3+7^3+8^3+9^3. The input is the value of n, the output is the summation. (you need if statement to check whether a number is a multiple of 5.In R, a%%b is the remainder for a divided by b. So, we have 10%%5=0) APPLIED STATISTICS 2 USE...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT