Category "verilog"

Generating number sequence in verilog (automat)

I was given a task to create verilog code that generates number sequence 323135343355. It should be generated like automat so it has states and next number in s

Divide by a number which is not power of 2 in Verilog RTL coding

For multiplication and division, we can use the left and right shifts. x>>2 // it will right shift by 2. ---> 2^2=4. (Multiply by 4 or divide by 4, de

How to change a register value without adding it to the sensitivity list?

module main(input A, B, C,button,clk100mhz,output [7:0]seg,[7:0]an); reg [3:0] D0; reg [3:0] D1; reg [3:0] D2; reg [7:0] Y; DISP7SEG m1 (clk

how can i take slice from a fifo buffer?

I write a code for asynchronous fifo ,here i am taking 32 bit write data and at write clock and getting a output at read clock . Here i am using 32 bit ASM(32'h

Modulo adder output shows no change

The output waveform shows no change in the sum, dif, burrow, and out. Even after increasing delay time, still the output shows no change. This should work like

I get a warning about $readmemh: Too many words in the file

Here is how I define the rom module module rom( input wire [31:0] inst_addr_i, output reg [31:0] inst_o ); reg [31:0] rom_mem[0:100];

Problems assigning to LEDs in a case block [duplicate]

When I enter something like this: always @* begin case(SW[17]) 1'b0: assign LEDG = SW[7:0]; 1'b1: assign LEDG = SW[15:8];

Understanding Verilog signal width parameter inheritance [duplicate]

I have a Verilog design from Xilinx that I am trying to understand. Coming from VHDL I have a hard time grasping the definitions inside the de

code for clock generation in structural verilog

I was trying to teach myself verilog programming from "The Verilog HDL" book by Thomas Moorby. In one of the exercises, they asked to generate a clock using str

How to write a module with variable number of ports in Verilog

I would like to write a module with a variable number of inputs, i.e. depending on some parameter, the result would be: module my_module #(LENGTH)( input c

Difference in Clock Generation

What is the difference between the following codes ? initial begin clk = 0 ; forever begin #5 clk = ~clk; end end initial begin clk = 0 ; fo

Verilog DUT System Verilog testbench: output to wire assignment 1s replaced with Xs

I have a Modelsim testbench in System Verilog testing a Verilog top-level module (ufm1) with another Verilog module (wishbone) used inside it, there's also a Sy

Verilog DUT System Verilog testbench: output to wire assignment 1s replaced with Xs

I have a Modelsim testbench in System Verilog testing a Verilog top-level module (ufm1) with another Verilog module (wishbone) used inside it, there's also a Sy