electronics forum

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

8 bit to 32 bit data conversion


Post new topic  Reply to topic    EDAboard.com Forum Index -> ASIC Design Methodologies & Tools (Digital) -> 8 bit to 32 bit data conversion
Author Message
anjo_ca



Joined: 08 Sep 2009
Posts: 4
Location: India


Post16 Oct 2009 8:01   

bit width convertor


i want to know how to convert 8 bit wide data to 32 bit wide one.actully i need a bit width convertor...can u plz help me giving some sugesstions.

with regards
Anjo CA
Back to top
ckaa



Joined: 06 Apr 2006
Posts: 15
Helped: 4


Post16 Oct 2009 21:52   

Re: bit width convertor


Well if you want to do it in HDL then just define a 32 bit number and assign it to zero and 'OR' it with your 8 bit number. That should change it to a 32 bit number. If you want to do it in C or a high level language I believe a combination of "OR" and shift functions should do it, not sure though.
The above is only for unsigned numbers. If your number is signed then I believe you need to sign extend your number and not pad the upper bits with zeros. You'll get lots of info on this if you search for 'sign extension' on google. I hope this helps!
Back to top
aslijia



Joined: 03 Nov 2006
Posts: 51
Helped: 1


Post19 Oct 2009 3:23   

bit width convertor


if you just using a high level language (such C or SV), you can just assign 32'hM = 8'hM (M is the number), also M is a non-signed number
Back to top
niravbhatt



Joined: 16 Mar 2009
Posts: 30
Helped: 2
Location: Ahmedabad,India


Post29 Oct 2009 5:49   

Re: 8 bit to 32 bit data conversion


I agree with the "ckaa". If you want to do it in HDL then just OR 8-bit number with 32 bit number.

It will work perfectly.

--
Nirav Bhatt
Back to top
dcreddy1980



Joined: 03 Dec 2004
Posts: 189
Helped: 25
Location: Munich, Germany


Post31 Oct 2009 4:08   

Re: 8 bit to 32 bit data conversion


I dont agree with "ckaa" and "nirav bhat" for suggesting to use a OR gate.

Why do u want add gate count, unless synthesis tool removes this OR gate, there is no use of it.

If you really want to make 32 bit from 8-bit, you need to simply tie GND(i.e Logic-0) to top-24 bits and the remaining 8-bits of your o/p would be your i/p.
Back to top
Google
AdSense
Google Adsense




Post31 Oct 2009 4:08   

Ads




Back to top
bepobalote



Joined: 19 Mar 2005
Posts: 72
Helped: 11
Location: Europe


Post31 Oct 2009 22:02   

Re: 8 bit to 32 bit data conversion


is your 8bit number signed or unsigned?
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 -> ASIC Design Methodologies & Tools (Digital) -> 8 bit to 32 bit data conversion
Page 1 of 1 All times are GMT + 1 Hour
Similar topics:
How to efficiently convert the 32-bit data into 8-bit data? (13)
8-bit data to 4-bit encoder (Verilog HDL) (2)
10 bit ADC conversion to 16 bit (3)
4-bit, 2-bit data type.. (5)
Difference in Writing Code between 8-bit/16-bit/32-bit Micro (1)
integer to 8-bit conversion (3)
Verilog - Float (16-bit) to real conversion (2)
16 bit to ascii conversion code in assembly language (1)
serial data to parallel two bit data (2)
How do I know whether 8-bit or 16-bit MCU shall be adopted? (2)


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