errang
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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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'; ?
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
But... I was also wondering how we'd get the bits to make the LEDs light up.