Link to home
Start Free TrialLog in
Avatar of errang
errangFlag for Afghanistan

asked on

Question about VHDL programming

Hey,

        I had a question about programming in VHDL.  I need to write a program that will multiply two (two bit) numbers without using the * (multiplication operator).

 I have figured out how to do this, we could do a bit shift to the left if we were multiplying by 2, and we could do the same and add the first number to the result if the number is being multiplied by 3.

I took a shot at writing the code, but it doesn't quite work...

Appreciate any help on this.
ASKER CERTIFIED SOLUTION
Avatar of Adam314
Adam314

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of errang

ASKER

Yea, I thought about that, I'll have to check if that's Ok.

But... I was also wondering how we'd get the bits to make the LEDs light up.
Avatar of Adam314
Adam314

Like I said... it's been a long time.

I think if you write the formulas for each of the output bits, the voltage on the pins will change as the input voltages change.  If you have LEDs connected, they will light up.
Avatar of errang

ASKER

Ah.. kk, thanks, I'll try that out when I get to the lab.
Depending on the current capabilities of your chip, you may need to condition the signal before connecting it to the LEDs.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of errang

ASKER

I am using a standard Spartan 3E FPGA board, and it does  have LEDs.  And I do realize I need to send a 1 to the LEDs to make them light up.

My main question is, if I'm using a 4 bit std_logic_vector out1 for the output, do I simply connect out1(0) to LED0, and go about it that way?

And do I have to assign the value to out1 bit by bit?  Like out1(0) <= '1';  ?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial