electronics forum

Rules | Recent posts | topic RSS | Search | Register  | Log in

Case range with bitstream: VHDL


Post new topic  Reply to topic    EDAboard.com Forum Index -> PLD, SPLD, GAL, CPLD, FPGA Design -> Case range with bitstream: VHDL
Author Message
lightofspace



Joined: 18 Oct 2006
Posts: 9


Post31 Oct 2006 11:43   

vhdl case range


Hi there!!
I am stuck in a problem of CASE range, I have the following code:
----------------------------------------------------------------------------
input_data: IN std_logic_vector (7 downto 0);
output: OUT std_logic_vector (3 downto 0);
.
.
.
.
case input_data is
when "00000001" => output <= "0010";
when "10000000" to "11111111" => output <= "1000";
when others => output <= "1111";
end case;
----------------------------------------------------------------------------
I want to make case range facility to work with binary also, how can I do this?
thanks in advance,
ahmad
Back to top
Google
AdSense
Google Adsense




Post31 Oct 2006 11:43   

Ads




Back to top
nand_gates



Joined: 19 Jul 2004
Posts: 907
Helped: 120


Post31 Oct 2006 14:11   

vhdl case when range


In this special case you can write the case as follows...
Code:
case input_data is
when "00000001" => output <= "0010";
when "00000000" => output <= "1111";
when others => output <= "1000"; -- "10000000" to "11111111"
end case;


Other way is you generate this case statement using some kind of script!!
Code:
case input_data is
when "00000001" => output <= "0010";
when "10000000" |
         "10000001" |
         "10000010" |
         ...................
         ...................
         "11111111" => output <= "1000";
when others => output <= "1111";
end case;
Back to top
Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
Post new topic  Reply to topic    EDAboard.com Forum Index -> PLD, SPLD, GAL, CPLD, FPGA Design -> Case range with bitstream: VHDL
Page 1 of 1 All times are GMT + 1 Hour
Similar topics:
Bitstream generation after some change of VHDL code (1)
IS VHDL CASE SENSITIVE (13)
case statement: VHDL (7)
[HELP] [VHDL] Jump case (1)
Case -when statement-VHDL (8)
will a case statement work inside a for loop ( vhdl) (2)
how to case my project pcb into a suitable case? (5)
Ultrasonic Range Finder in VHDL..plz help (6)
VHDL : 'Integer' range and its use (2)
Best case and worst case (2)


Abuse || Administrator || Moderators || Support us || sitemap
topic RSS