6. (20%) Write HDL code to synthesize the following circuits:
a. 8-bit register.
b. 9-bit Register with Asynchronous Reset
c. N-bit Register with Synchronous Reset where N is a parameter
d. N-bit register with Enable and Asynchronous reset where N is a parameter
e. 8-bit latch
//Part A)
module register_8bit (clk, in1, out1);
input clk;
input [7:0] in1;
output [7:0] out1;
reg [7:0] out1;
always @(posedge clk)
begin
out1 <= in1;
end
endmodule
//Part B)
module register_9bit (clk, rst, in1, out1);
input clk;
input rst;
input [8:0] in1;
output [8:0] out1;
reg [8:0] out1;
always @(posedge clk or posedge rst)
begin
if (rst == 1'b1)
out1 <= 9'd0;
else
out1 <= in1;
end
endmodule
//Part C)
module register_Nbit_sync (clk, rst, in1, out1);
parameter N = 8;
input clk;
input rst;
input [N-1:0] in1;
output [N-1:0] out1;
reg [N-1:0] out1;
always @(posedge clk)
begin
if (rst == 1'b1)
out1 <= 9'd0;
else
out1 <= in1;
end
endmodule
//Part D)
module register_Nbit_async (clk, rst, en, in1, out1);
parameter N = 8;
input clk;
input rst;
input en;
input [N-1:0] in1;
output [N-1:0] out1;
reg [N-1:0] out1;
always @(posedge clk or posedge rst)
begin
if (rst == 1'b1)
out1 <= 9'd0;
else if (en == 1'b1)
out1 <= in1;
end
endmodule
//Part E)
module latch_8bit (clk, in1, out1);
input clk;
input [7:0] in1;
output [7:0] out1;
reg [7:0] out1;
always @(posedge clk)
begin
out1 = in1;
end
endmodule
6. (20%) Write HDL code to synthesize the following circuits: a. 8-bit register. b. 9-bit Register...
WRITE IN SYSTEM VERILOG:
Write a HDL code for 1 bit D-register with a rising edge clock, a synchronous active-low reset and an asynchronous active-high enable pin. B2.
Write a HDL code for 1 bit D-register with a rising edge clock, a synchronous active-low reset and an asynchronous active-high enable pin. B2.
Use the Quartus Prime Text Editor to implement a structural
model of the 4-bit data register shown above in a file named
reg_4bit.sv. Specify the 4-bit data register’s module according to
the interface specification given in the table below.
Port
Mode
Data Type
Size
Description
RST
in
logic
1-bit
Active high asynchronous reset
CLK
in
logic
1-bit
Synchronizing clock signal
EN
in
logic
1-bit
Synchronous clock enable
D
in
logic vector
4-bits
Synchronous data input
Q
out
logic vector
4-bits...
I need help doing the code using Verilog modelsim Design a 32-bit register using the D Flip-Flop from part (1) so that it has the following features: (a) The Register has these ports Outputs: Q[31:0] Inputs: D[31:0] CLK is the clock signal EN is a synchronous signal for enabling the register. When EN is asserted at the sensitive edge of the CLK, the input D is loaded into the register. RESET We will leave this input unconnected, but will define...
a) (5 marks) Explain the difference between a latch, a gated latch and a flip flop. b) (5 marks) A gated SR latch has the following schematic diagram CLK a) Draw a timing diagram showing the Q and Q outputs for the following sequence of inputs: CLK R Assume that the initial state of the outputs is Q 0 and Q 1 c) (5 marks) Draw a schematic diagram for a rising edge-triggered master-slave D flip- flop built using two...
6. Show how to connect a 74HC93 4-bit asynchronous counter for each of the following moduli: (a) 9 (b) 11 (c) 13 (d) 14 (e) 15 10. The waveforms in Figure 9-69 are applied to the count enable, clear, and clock inputs as indi- cated. Show the counter output waveforms in proper relation to these inputs. The clear input is asynchronous. CTEN CTENCTR DIV 16 CLR
please give the verilog code and explain in the form
of comments.
Part I Consider the circuit in Figure 1. It is a 4-bit synchronous counter (text Section 5.9.2) that uses four T-type flip- flops (text Section 5.5). The counter increments its value on each positive edge of the clock if the Enable signal is asserted. The counter is reset to 0 by setting the Clear b signal low - it is an active-low asynchronous clear. You are to implement...
Consider the circuit in Figure 1. It is a 4-bit (QQ2Q3) synchronous counter which uses four T-type flip-flops. The counter increases its value on each positive edge of the clock if the Enable signal is asserted. The counter is reset to 0 by setting the Clear signal low. You are to implement an 8-bit counter of this type Enable T Q Clock Clear Figure 1. 4-bit synchronous counter (but you need to implement 8-bit counter in this lab) Specific notes:...
Please implement the function z(a, b, c) in Verilog HDL. Note: Please write your code in one module. ? = ? × ? + ?, where ? = ?^3 − ? ? = ???? ( 8/?×? , ?) Hint: output wire z; input wire a, b, c
6. An 8-bit shift register has the binary equivalent of the decimal number 46 stored in it What are the base-10 equivalent contents of the register after the following operations have been performed? For each case, assume the same initial state given. [15pts] (a) SHR 1 (b) SHL 1 (c) SHR 2 (d) ROR 2
6. An 8-bit shift register has the binary equivalent of the decimal number 46 stored in it What are the base-10 equivalent contents of the...
6.(15 points) a)Write VHDL code for the following Soda Dispenser controller. It is a synchronous FSM with an active high Reset signal. b) What type of FSM is? States: Init, Wait, Disp Inputs Enough Outputs d, cl Reset Init nough o Wait cl= Enough 1 isp
6.(15 points) a)Write VHDL code for the following Soda Dispenser controller. It is a synchronous FSM with an active high Reset signal. b) What type of FSM is? States: Init, Wait, Disp Inputs Enough...