Questions tagged [hdl]

HDL (Hardware Description Language) is a description language used to describe the behavior of digital circuits. Examples are Verilog, VHDL and ABEL.

Filter by
Sorted by
Tagged with
0 votes
1 answer
50 views

SystemVerilog array of parameters/constants

If I have code like this: ...
lousycoder's user avatar
2 votes
2 answers
127 views

Can anyone please take a look of this Verilog HDL code? Does it look strange by any means?

I am wondering if it is ok to use output instead of wire for another output in Verilog coding (using Quartus for this). Just ...
towel Lijiang's user avatar
2 votes
1 answer
151 views

My 1-bit ALU is not able to do subtraction [closed]

I am trying to make a 4-bit ALU in Verilog which can perform the following functions: Add Subtract Compare (>,<,=) AND The approach I have taken is to make 4, 1-bit ALUs and connect them in ...
Koustubh Jain's user avatar
1 vote
1 answer
62 views

How to legally/properly run a Verilog file that needs other files?

I have written a simple ripple carry adder in Verilog (in a structural fashion), and I have defined the required half adder in a module in another file. When I run them (using ...
Koustubh Jain's user avatar
3 votes
2 answers
405 views

Why does this Verilog code work without "wire" statements?

My textbook (Brown and Vranesic) gives the following code for a simple 4-bit RCA implementation in Verilog: ...
EE18's user avatar
  • 309
1 vote
1 answer
77 views

How do I easily create waveform for an expression having more than one signal inside an "if else" block in Vivado?

In a sample code where I have 2 net type variables, I want to plot a waveform for a conditional statement like this: ...
lousycoder's user avatar
-1 votes
1 answer
145 views

Logical AND vs Bitwise AND for single bit and multibits [duplicate]

What is the functional and physical difference in using Logical AND ( && ) and Bitwise AND (&&) over singlebit and multibit signals. Below shared cases. case 1: A[3:0] & B[3:0] = ?...
DonMano's user avatar
  • 11
0 votes
1 answer
60 views

How to do clock signal rising edge detection in Chisel (scala)?

I have encountered in a problem of rising edge detection in writing chisel code. Here is the code I wrote. ...
Chenhe yuan's user avatar
2 votes
2 answers
129 views

Parsing variable-sized data in 32-bit datastream

I have a 32-bit datastream coming from a sensor. The data is encoded as a Type-Length-Value encoding. This means the first byte indicates what kind of data there is and the second byte contains the ...
John Smith's user avatar
1 vote
1 answer
88 views

What's the correct way of port declaration while instantiating modules in Verilog HDL?

From what I know, if we need to instantiate module1 in module2, then I need to declare all the ...
Killjoy's user avatar
  • 121
0 votes
1 answer
55 views

Why does this Verilog testbench not undergo a race condition?

This is the testbench in question: ...
Killjoy's user avatar
  • 121
1 vote
1 answer
49 views

How do I figure out if my Verilog code output was generated out of race condition?

Apart from physical observation, is there a way to know if my code will undergo a race condition? For example, the following code has a race condition because both ...
Killjoy's user avatar
  • 121
0 votes
0 answers
78 views

How do I use conditional compilation in Xilinx Vivado?

I want to conditionally include one of three files if the respective macro for that file has been defined. Normally I would define the macros in a separate file, say ...
Killjoy's user avatar
  • 121
2 votes
1 answer
314 views

How do I create a 2D array in Verilog?

I want to use a 2D array in a Verilog testbench. I tried it this way: ...
Killjoy's user avatar
  • 121
1 vote
1 answer
108 views

What's the purpose of "functions" if they can be replaced by "tasks" in Verilog HDL?

In Verilog, a task can do everything that a function can along with having other features. Then what's the purpose of having ...
Killjoy's user avatar
  • 121
1 vote
1 answer
100 views

What am I doing wrong with this 2x2 Karatsuba Multiplier in Verilog HDL?

I am trying to implement a 2x2 karatsuba Multiplier which I will be using as a base case for a higher bit multiplier. Here's the code: ...
Killjoy's user avatar
  • 121
3 votes
1 answer
496 views

Why is my Karatsuba multiplier not giving right answers for large numbers?

I tried to implement 16-Bit Karasutba Multiplier in Verilog HDL. It gives me right answers for small numbers, but it's incorrect for large numbers. Can someone point out what's wrong? Here's the ...
Killjoy's user avatar
  • 121
1 vote
1 answer
52 views

How can I compare the speed of two algorithms implemented in verilog HDL without using FPGA?

I have implemented two 32 bit multiplier algorithms (Booth and Karatsuba) in verilog HDL. I wanted to make a comparison of the time taken by both algorithms to multiply same numbers. How can I do that ...
Killjoy's user avatar
  • 121
0 votes
2 answers
154 views

How do I instantiate modules within case statements in Verilog HDL?

I am trying to make a sequence detector with 4 modes - Moore machine overlapping & non-overlapping and Mealy machine overlapping & non-overlapping. But writing my code like this gives me an ...
Killjoy's user avatar
  • 121
3 votes
2 answers
556 views

How do you invert a section of a four bit wide signal in Verilog?

I'm working on this lab from the ETH Zurich course on Digital Design. I'm creating a truth table for signals to lines in a 7-segment number display. The display is controlled by a 4-bit input. One of ...
Connor's user avatar
  • 389
2 votes
1 answer
274 views

How to write program counter in SystemVerilog?

I was trying to build an 8-bit program counter, and it should support branching. This is what I wrote: ...
Chenhe yuan's user avatar
-1 votes
1 answer
243 views

Delaying falling edge, and faster rising edge for output signal [closed]

I'm trying to take an incoming signal to use as an output, but that output (active low) needs to be enabled about 20ns after the incoming signal goes low, and then go high again about 20ns before the ...
mikerakesh's user avatar
0 votes
2 answers
234 views

When using Cocotb, should I be using FallingEdge to set and assert values?

I'm attempting to use Cooctb to verify a simple Verilog counter with a reset: ...
Dave Dribin's user avatar
3 votes
1 answer
235 views

Basic addition not working as expected

I'm trying to add two numbers together, and it's giving an odd result. Here's the code, ...
Lethe563's user avatar
  • 115
1 vote
1 answer
112 views

What value will be assigned to x, is it a or ~x?

I have some Verilog code for which I am unsure of the outcome of the non-blocking assignment of x as shown below : ...
davos's user avatar
  • 13
0 votes
0 answers
43 views

How flexible are modern HDL Synthesis tools in terms of output primitives?

As a firmware guy I'm fascinated with porting tools like GCC to support arbitrary weird processors, which nowadays can be manifested on FPGAs with relative ease. I'm curious whether something ...
Aaron Linnell's user avatar
7 votes
2 answers
917 views

Identifying an edge INSIDE an 'always' block

I am an experienced C programmer trying to learn enough Verilog to create a brushless motor controller. I am nearly done except for one detail. I want to do something like this: ...
Tinkerer's user avatar
0 votes
1 answer
76 views

Are there other examples of applications of a priority arbiter apart from sharing system bus or memory?

I was wondering where else a priority arbiter is used in the real world, apart from sharing a system bus or memory. I tried googling, but couldn't find any other examples. For context: I'm working on ...
Ash's user avatar
  • 23
0 votes
2 answers
182 views

Are SR latches bad in ASIC design?

I am implementing an ASIC design, and my current solution for a problem requires an SR latch. I've always been told that latches are bad in FPGA and ASIC designs, but never got a proper answer as to ...
Elzaidir's user avatar
  • 103
0 votes
1 answer
86 views

Verilog counter is not working using @always statement

I am trying to implement counter using Verilog HDL ...
nai1ka's user avatar
  • 3
1 vote
1 answer
228 views

Dense Neuron Neural Network in Verilog

I am trying to build NN in system verilog, but I am facing a problem with neuron implementaion, as it only displays 'x'. ...
Ghadeer Ali Jaradat's user avatar
2 votes
1 answer
41 views

Why I am having x as output from ReLU?

I am trying to test ReLU, but it always gives 'x' for the output. ...
Ghadeer Ali Jaradat's user avatar
2 votes
1 answer
95 views

VHDL: Variables depending on other variables

If I'm in a process and I have a variable (A) changing and a different variable (B) changing based on the original variable (A), does other variable (B) change based on the new value or the initial ...
Q-Tip's user avatar
  • 195
0 votes
1 answer
114 views

Performance metrics for a VHDL/Verilog RTL design

Correctness and performance is everything in programming. Verifying it for software is relatively easy because you can "just" run the program and see if it crashes and/or is very slow. ...
Stand with Gaza's user avatar
0 votes
1 answer
533 views

Unpacked and Packed Arrays

I have been reading on the unpacked and packed arrays in SV. I have mostly understood the concepts and style with which arrays are declared. However, there are some particular cases: ...
Sac's user avatar
  • 41
0 votes
2 answers
378 views

FPGA applications in power electronics [closed]

I'm a power electronics hardware design engineer and I'm trying to build some additional skills like a sub-branch. I've always been interested in FPGAs and I decided to combine my major skill with my ...
Das D.'s user avatar
  • 199
0 votes
0 answers
135 views

Sequence of execution of "always" and "generate" blocks

I'm fairly new to Verilog. I have been writing some code by myself and need some help. The following is the code for a serial to parallel interface. ...
Sac's user avatar
  • 41
0 votes
1 answer
102 views

Alternative to using FSM for implementing round robin

It is easy to implement round robin (A->B->C->A->B->C..) using FSM in VHDL. Is there an alternative to FSM? For some reason, I have a feeling there is a nice and neat implementation ...
user7586189's user avatar
3 votes
4 answers
855 views

Difference in synthesis between bitwise AND (&) and logical AND (&&)

Would these two code snippets synthesize the same way? I know this will be tool dependent because all synthesizers are slightly different. That being said, I think they probably tend to agree on this ...
igrok's user avatar
  • 45
-1 votes
1 answer
711 views

Is it possible to display a custom error message in Synplify syntezis with SystemVerilog code?

I write some library module on SystemVerilog. I want to check input parameters on synthesis and then if their values are wrong I want to stop synthesis with a custom error that will tell which ...
Arseniy's user avatar
  • 2,192
1 vote
1 answer
127 views

Why does adding "& 1" to an assign statement produce a completely different synthesis?

I am trying to implement a one-bit full adder in Verilog. Here's my original code: ...
Syed Fahad's user avatar
1 vote
2 answers
234 views

Why is order of bits not getting reversed?

In this code, while declaring in and out, the seventh bit of input is MSB, while the zeroth bit of output is MSB. So, why is the ...
debashish's user avatar
0 votes
1 answer
174 views

Modelsim Altera not working [closed]

Hi i'm new to verilog designing and i'm trying to simulate but modelsim doesn't even load the design, i'm glad if someone could help, thanks. ( counter and contatore are two modules that i included in ...
Rohit's user avatar
  • 1
0 votes
1 answer
538 views

Syntax error Begin statement HDL 9-806

I have an error in the form of HDL 9-806 on the begin statement. The code below is a button based sequence detector an addition LED flash when sequence is correct with a debouncer to stop multiple ...
S G's user avatar
  • 1
0 votes
1 answer
454 views

What is the logic behind the behaviour of reg in Verilog?

I know SystemVerilog and now I'm trying to learn pure Verilog. I find the way reg works to be rather odd. I thought wire is used ...
Natt's user avatar
  • 15
0 votes
1 answer
202 views

Build on-chip ROM in HDL

I wrote the next code in quartus 15.0, where I show what I want to do for a specific project. I can write it both in VHDL and Verilog HDL, but verilog is notoriously shorter. ...
emma97's user avatar
  • 58
3 votes
1 answer
271 views

Ternary operator doesn't work in Icarus Verilog

I have the following Verilog modules, which I'm simulating with Icarus Verilog. It seems that the ternary operator doesn't work, or has a bug: main module (i2c_app_tb.v) ...
Martel's user avatar
  • 1,215
-1 votes
5 answers
585 views

Why Hardware Description Language?

Before moving to understand the purpose of Hardware Description Language(HDL), we need to know what is HDL? From wiki, A hardware description language enables a precise, formal description of an ...
F.C. Akhi's user avatar
  • 139
1 vote
4 answers
460 views

What is the difference between throughput and operating frequency of a digital system?

I am designing a digital system with 2 pipeline stages. While synthesizing the design in Xilinx ISE, I find that the latency of the critical path is 19ns. The clock period estimate for my design is ...
AugmentiuM's user avatar
1 vote
2 answers
4k views

Positive edge reset and negative edge reset

I am new to Verilog and I am trying to implement an asynchronous reset. I have difficulties understanding the difference between using ...
zh__'s user avatar
  • 13

1
2 3 4 5 6