R
Rick C
Guest
I\'m starting a new project so I need to come up the learning curve again. I always forget details of the language when I don\'t use it for some time.
I think I\'m not so much not remembering something that is in the language as it is I\'m thinking of something that\'s NOT in the language, but I wish it were. I\'m probably mixing my poor recollection of C with my poor recollection of VHDL.
VHDL has a ?? operator that converts a std_logic or bit value to Boolean. It took me a while to realize I\'m looking for something that does the opposite, converts a Boolean to a std_logic value.
I can do what I want to do using when and else, but they tend to make the line more crowded, so if the expression is a bit wordy (what isn\'t in VHDL) it runs onto two lines. I also don\'t like the syntax which spreads the two alternatives to opposite ends of the statement.
The syntax I\'m remembering is something like
A <= condition ?? X : Y
I think this is the C construct. I just have this image in my mind of this being trotted out as a new VHDL feature, or something like it.
So someone tell me I\'m totally misremembering it. I\'ve dug the Internet and not found any gold. I\'m pretty sure I would have found it if it were there.
Or is there a conversion for boolean to std_logic? I seem to remember searching that the other day and finding nothing other than examples of your own conversion function.
--
Rick C.
- Get 1,000 miles of free Supercharging
- Tesla referral code - https://ts.la/richard11209
I think I\'m not so much not remembering something that is in the language as it is I\'m thinking of something that\'s NOT in the language, but I wish it were. I\'m probably mixing my poor recollection of C with my poor recollection of VHDL.
VHDL has a ?? operator that converts a std_logic or bit value to Boolean. It took me a while to realize I\'m looking for something that does the opposite, converts a Boolean to a std_logic value.
I can do what I want to do using when and else, but they tend to make the line more crowded, so if the expression is a bit wordy (what isn\'t in VHDL) it runs onto two lines. I also don\'t like the syntax which spreads the two alternatives to opposite ends of the statement.
The syntax I\'m remembering is something like
A <= condition ?? X : Y
I think this is the C construct. I just have this image in my mind of this being trotted out as a new VHDL feature, or something like it.
So someone tell me I\'m totally misremembering it. I\'ve dug the Internet and not found any gold. I\'m pretty sure I would have found it if it were there.
Or is there a conversion for boolean to std_logic? I seem to remember searching that the other day and finding nothing other than examples of your own conversion function.
--
Rick C.
- Get 1,000 miles of free Supercharging
- Tesla referral code - https://ts.la/richard11209