Here is essentially what the hardware looks like. The i_ prefix means input or intermediate signal to a register. What you have is one register for detecting a falling edge on the Switch_1 signal and another register for toggling the LED output whenever a falling edge occurs on the Switch_1 signal. Note that wrapping the output of a register back to the ...
Yea, you can use the simple solution of creating an internal signal:
signal done : std_logic ;
Use this signal inside your clocked process.
And simply assign it to o_done as a concurrent statement inside architecture definition:
o_done <= done ;
I haven't really had the need to use buffer ports in VHDL codes till now. This is something I extracted from ...
Misundertanding in the working of for loop
When your count = 4, unroll the loop to understand what happens in the hardware. You assign multiple vales to SDATA_ADC:
SDATA_ADC <= ADDR_DATA (15);
SDATA_ADC <= ADDR_DATA (14);
SDATA_ADC <= ADDR_DATA (0);
But only one serial data will be sent via SDATA_ADC in that clock edge, ie., ADDR_DATA (0).
Just for completeness, answer is already in the comments
An entity of a VHDL component has to match the filename. Therefore you should either rename the entity to adder1 or the file to signed_adder.vhdl.
As mentioned there are other potential issues in your code
a_sig <= UNSIGNED(a);
The compiler should complain here because you try to assign an 8bit ...
There's a lot of technical details to simulation and instantiation. But I'd like to avoid the algebraic approaches and just focus on the visual aspects for a moment. It may help. (You've avoided variables, but I may decide to address them for a moment below.)
It's probably better if you think of a signal as the same thing as a named wire. So when you write ...
In VHDL-2008 or newer you can use a "-" as don't care in a select statement if your synthesizer implements this feature.
See UG901 (Vivado Design Suite User Guide) page 217.
if clk’event and clk=’1’ then
with my_reg select?
For the Finite State Machine (FSM), you need to clearly define your inputs, outputs, states, and transitions.
And for VHDL-2008, sensitivity lists are a thing of the past (they used to cause lots of bugs due to simulator/synthesiser mismatches). They have been replaced with process(all).
This is an example of state names you could use without using a ...
Can you nest elseif in if, then else statements ?
You are certainly allowed to nest "if" statements inside each-other. This is perfectly legal code.
if boolean_expression_1 then
if boolean_expression_1a then
elsif boolean_expression_1b then
elsif boolean_expression_1c then
VHDL shouldn't be treated like a programming language. VHDL is a hardware description language. Whatever codes written in concurrent section have nothing to do with "time", and the order of codes doesn't matter. That means it's equivalent to a circuit operating at "all times", i.e. independent of time.
ISERDES is what you are looking for. 7-series libraries guide will give information about the instantiation of the ISERDES. But UG471 - 7 Series FPGAs SelectIO Resources User Guide will give more information on ISERDES. (You might find some other interesting components).
Sounds ok to me. I've implemented PID too for a power device using PWM. Ensure you're resetting the PWM at zero crossing. Also you might want to consider how frequently you can update the PWM value. I mean , the comparison in FPGA would be much faster than the loop. Consider soft-starting if you need.
Now is obviously an impure function.
One characteristic of a pure function is that the output depends ONLY on the input arguments : the importance of which is that it can be optimised : e.g. computed ONCE and only recomputed if the args change (which, with a parameterless function, they don't). That clearly won't give the desired result for Now.
You can add ...
The code you wrote in your question is not likely to work as you expect, as you are inferring a latch (which is almost never a good design, and usually unintentional, as I suspect it was here). The latch is due to the fact that your process is retaining your previously set bits.
Do you really want your "decoder" to have memory? If so, I would call ...
Adding a to the sensitivity list and removing the if statement makes this code works perfectly.
Once again thanks for your time.
b <= (others => '0');
b(to_integer(unsigned(a))) <= '1';
You could use the unary operators, e.g.:
signal my_vector: std_logic_vector(7 downto 0);
if and my_vector then
-- Do something for all 1...
elsif nand my_vector then
-- Do something for at least one 0...
elsif or my_vector then
-- Do something for at least one 1...
elsif nor my_vector then
-- Do something for all 0...