Sign in

username:

password:



Not a member?

Search Comp.Arch.FPGA



Search tips

fpga by Keywords

Altera | ASIC | CPLD | Cyclone | DCM | DDR | DSP | Ethernet | ISE | JTAG | Linux | LVDS | Microblaze | ML310 | Modelsim | NIOS | OPB | PCI | Quartus | RocketIO | SDRAM | Spartan | Spartan3 | SRAM | Stratix | Verilog | VHDL | Virtex | Virtex-4 | Virtex-II | Xilinx | XST

Ads

See Also

DSPEmbedded SystemsElectronics

Comp.Arch.FPGA | vhdl divider

There are 4 messages in this thread.

You are currently looking at messages 0 to 4.

vhdl divider - zanaticul - 2010-01-30 13:34:00

Hello,

i want to split a number for example 1234 in 4 numbers 1,2,3,4 
witch is the best way to do it?

i was thinking of using this code

		tmp := number;
		
		o4 := number mod 10;
		tmp := tmp-o4;
		
		o3 := number mod 100;
		tmp := tmp-o3;
		o3 := o3/10;
		
		o2 := number mod 1000;
		tmp := tmp-o2;
		o2 := o2/100;
		
		o1 := number /1000;	

but i get an error: ERROR:HDLParsers:808 -"D:/Work/fpga/projects/stopWatch/nr.vhd" Line 53. * can not have suchoperands in this context.

10x in advance

	   
					
---------------------------------------		
Posted through http://www.FPGARelated.com



Re: vhdl divider - Mike Treseler - 2010-01-30 15:30:00

zanaticul wrote:

> but i get an error: ERROR:HDLParsers:808 -
> "D:/Work/fpga/projects/stopWatch/nr.vhd" Line 53. * can not have such
> operands in this context.

http://lmgtfy.com/?q=vhdl+stop+watch
______________________________
Join the blogging team on FPGARelated.com and earn rewards! Details Here.

Re: vhdl divider - John_H - 2010-01-31 08:10:00

On Jan 30, 1:34=A0pm, "zanaticul"
<cosminc...@yahoo.com> wrote:
> Hello,
>
> i want to split a number for example 1234 in 4 numbers 1,2,3,4
> witch is the best way to do it?

If you're just looking to display the binary value in decimal, do a
quick search for "binary to bcd converter" and you should find nice
little serial implementations that let you digest a digit at a time
out of the original binary number.  The serial implementation is quite
nice.  Since visual representation of the numbers doesn't have to
occur at 50 MHz, the serial implementation is usually quite adequate.

The first google hit shows the process extremely well:
http://www.engr.udayton.edu/faculty/jloomis/ece314/notes/devices/binary_to_=
BCD/bin_to_BCD.html

- John_H
______________________________
Join the blogging team on FPGARelated.com and earn rewards! Details Here.

Re: vhdl divider - Kolja Sulimma - 2010-02-02 06:42:00

On 30 Jan., 19:34, "zanaticul"
<cosminc...@yahoo.com> wrote:

> i was thinking of using this code
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 tmp :=3D number;
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 o4 :=3D number mod 10;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 tmp :=3D tmp-o4;
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 o3 :=3D number mod 100;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 tmp :=3D tmp-o3;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 o3 :=3D o3/10;
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 o2 :=3D number mod 1000;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 tmp :=3D tmp-o2;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 o2 :=3D o2/100;
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 o1 :=3D number /1000; =A0 =A0
>
> but i get an error: ERROR:HDLParsers:808 -
> "D:/Work/fpga/projects/stopWatch/nr.vhd" Line 53. * can not have such
> operands in this context.

And which line is line 53?
I can't see any "*" in the code you presented.

Kolja Sulimma
______________________________
Join the blogging team on FPGARelated.com and earn rewards! Details Here.