Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

8 bit to 32 bit data conversion

Status
Not open for further replies.

anjo_ca

Newbie level 3
Joined
Sep 8, 2009
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
India
Activity points
1,306
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
 

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!
 

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
 

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
 

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.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top