How to use the most common VHDL type: std_logic

  Рет қаралды 23,795

VHDLwhiz.com

VHDLwhiz.com

Күн бұрын

Learn how to create a signal of type std_logic in VHDL. A std_logic signal models the value that a can be carried by a single wire in a digital logic circuit.
Blog post for this video:
vhdlwhiz.com/s...
To use the std_logic type, this IEEE library must be imported at the top of the .vhd file:
library ieee;
use ieee.std_logic_1164.all;
The syntax to declare a signal of type std_logic:
signal signal_name : std_logic := [intial_value];
The initial value may omitted. The default initial value is 'U', which means "uninitialized".
A signal or variable of the std_logic type can have any of the following values:
'1' - Binary 1
'0' - Binary 0
'U' - Uninitialized
'X' - Unknown / multiple drivers
'Z' - High impedance / no driver
'H' - Weak 1 / pullup
'L' - Weak 0 / pulldown
'W' - Weak signal, can't tell if 1 or 0
'-' - Don't care (used in comparisons)
Normally we only use the values '1' or '0' to model a bit value. When 'X' or 'U' appear, its usually because of some kind of error. The other meta-values are mostly used for modelling external interfaces.
The std_logic is a resolved type. What this means is that if we try to drive differing values onto the same signal from two or more processes, the value will be determined by a "resolution table". This means that the program won't crash, but the signal might get a different value than any of the drivers are applying to it. The most common meta-value is 'X'.

Пікірлер: 27
@XDbiggy
@XDbiggy 4 жыл бұрын
Your compilation errors are an extremely good strategy for making your viewers learn and retain info. I like it!
@VHDLwhiz
@VHDLwhiz 4 жыл бұрын
Thanks! Then I will do more of that when it's applicable.
@Ma1ne2
@Ma1ne2 Жыл бұрын
Amazing tutorial series to far! I am having a lot of fun a learning great new stuff!
@Formula_myan
@Formula_myan 8 ай бұрын
bro u are a wizard i'm a masters student and i choose vhdl but idk have the coding knowledge i had the background of doing it in CRO (cathode ray osciloscope) i was struggling to do my assignments now i can rely on ur playlist
@zrpgelo
@zrpgelo 3 жыл бұрын
Thanks! I've already made the signals appear in the 'Objects' by just unchecking 'Enable Optimization' before the simulation.
@unguder
@unguder 10 ай бұрын
For the ones who cannot see signals in the "object" window, after clicking the "enable optimization" enter the "optimization options" in "start simulation" window. Then choose " Apply full visibility to all modules"
@marcomoldenhauer7903
@marcomoldenhauer7903 11 ай бұрын
The explanation is very clear! Thank you very much!
@parkerd2154
@parkerd2154 6 жыл бұрын
Keep the great videos coming. You're really helping a lot of people and you deserve more subs
@VHDLwhiz
@VHDLwhiz 6 жыл бұрын
Thank you! Good to hear that you are finding them useful. I am actually rendering a new video about finite-state machines right now.
@parkerd2154
@parkerd2154 6 жыл бұрын
excellent!
@ryledesirabelli4151
@ryledesirabelli4151 4 ай бұрын
how do you declare std_logic in the entity ?
@greggkulcak6348
@greggkulcak6348 2 жыл бұрын
In ModelSim my waves are always displayed at an offset of 100ns, so 0-100 is blank and then my signals start showing at the 100ns point. Is there any way to fix this in the settings?
@VHDLwhiz
@VHDLwhiz 2 жыл бұрын
If you run the simulation for 100 ns without opening the waveform and then add the signals to the waveform, then you may see that the first 100 ns are blank. That's because their values haven't been recorded until you added the signals to the waveform at 100 ns. Try to type "restart; run 100 ns" after adding the signals, but without closing the waveform. It should record the values from 0 ns on that second run.
@greggkulcak6348
@greggkulcak6348 2 жыл бұрын
@@VHDLwhiz Yes it looks like that was the issue I was causing, thanks for the reply!
@mati3me
@mati3me 4 жыл бұрын
well explained
@mazenezzeddine8319
@mazenezzeddine8319 6 жыл бұрын
Thanks. In driver B, why signal 2 and 3 assignments are affected despite there is no wait statements?
@valerioantoniovicidomini6498
@valerioantoniovicidomini6498 6 жыл бұрын
second process has a sensitivity list, it wont start again if Signal1 doesn't change.
@sakuranooka
@sakuranooka 3 жыл бұрын
@@valerioantoniovicidomini6498 You mean, "third" process, right?
@sakuranooka
@sakuranooka 3 жыл бұрын
The second process doesn't have a sensitivity list, but still seems to be executed in each iteration. How come?
@atlaskaiser9951
@atlaskaiser9951 2 жыл бұрын
Check the Dataflow, in simulation right-click on your file name, and select 'add Dataflow'.
@luthfymuhammad788
@luthfymuhammad788 2 жыл бұрын
why doesn't my signal appear in "object". is there a solution for this?
@VHDLwhiz
@VHDLwhiz 2 жыл бұрын
Probably because you have selected a different instance in the "Sim" tab. Click around in the Sim tab to the left of the ModelSim window, and you will see other signals appear in the Objects window.
@gustavosousa4363
@gustavosousa4363 3 жыл бұрын
what to do when it gives you an error? " std_logic does not match with a string literal"
@VHDLwhiz
@VHDLwhiz 3 жыл бұрын
Perhaps you used double quotes "1" instead of single quotes '1'?
@atlaskaiser9951
@atlaskaiser9951 2 жыл бұрын
try capital 'Z' instead of 'z'.
@Gian95R
@Gian95R 5 жыл бұрын
Could you please give us some exercise?
@VHDLwhiz
@VHDLwhiz 5 жыл бұрын
You can try one of the VHDL code quizes at vhdlwhiz.com/basic-vhdl-tutorials/
How to create a signal vector in VHDL: std_logic_vector
10:11
VHDLwhiz.com
Рет қаралды 38 М.
How to Use a Procedure in VHDL
15:16
VHDLwhiz.com
Рет қаралды 17 М.
How to whistle ?? 😱😱
00:31
Tibo InShape
Рет қаралды 16 МЛН
А что бы ты сделал? @LimbLossBoss
00:17
История одного вокалиста
Рет қаралды 10 МЛН
Who’s the Real Dad Doll Squid? Can You Guess in 60 Seconds? | Roblox 3D
00:34
🕊️Valera🕊️
00:34
DO$HIK
Рет қаралды 11 МЛН
Experimenting with Buses and Three-State Logic
18:43
Sebastian Lague
Рет қаралды 609 М.
How Wozniak’s code for the Apple 1 works
37:18
Ben Eater
Рет қаралды 333 М.
9.3. IEEE library & std_logic
9:16
Electron Tube
Рет қаралды 7 М.
How to use Signed and Unsigned in VHDL
9:41
VHDLwhiz.com
Рет қаралды 34 М.
How the Best Hackers Learn Their Craft
42:46
RSA Conference
Рет қаралды 2,6 МЛН
I2C and SPI on a PCB Explained!
15:34
Altium Academy
Рет қаралды 152 М.
How to use a Case-When statement in VHDL
6:50
VHDLwhiz.com
Рет қаралды 24 М.
Vim Tips I Wish I Knew Earlier
23:00
Sebastian Daschner
Рет қаралды 72 М.
How to whistle ?? 😱😱
00:31
Tibo InShape
Рет қаралды 16 МЛН