Keyboard input help

R

Rishi Dhupar

Hi,

Trying to figure out how I can concatanate input from a keyboard. I
cannot seem to figure out how I would store the number "12" from
keyboard input. The user presses 1, gets stored somewhere then he
presses 2, then that gets stored somewhere. How can I like put these
together so verilog knows it is "12"?

Basically I am just doing keyboard input to LCD output.
Type in a 3 digit number on KB and press the space key, and it should
print out the number * 2 to the LCD.

Thanks for any help.

Rishi Dhupar
 
C

Colin Paul Gloster

On Mon, 13 Aug 2006, Rishi Dhupar wrote:

"Trying to figure out how I can concatanate input from a keyboard. I
cannot seem to figure out how I would store the number "12" from
keyboard input. The user presses 1, gets stored somewhere then he
presses 2, then that gets stored somewhere. How can I like put these
together so verilog knows it is "12"?

[..]"

You could use just about any data structure, e.g. an array or a FIFO. This
is not a Verilog newsgroup.
 
B

backhus

Rishi said:
Hi,

Trying to figure out how I can concatanate input from a keyboard. I
cannot seem to figure out how I would store the number "12" from
keyboard input. The user presses 1, gets stored somewhere then he
presses 2, then that gets stored somewhere. How can I like put these
together so verilog knows it is "12"?

Basically I am just doing keyboard input to LCD output.
Type in a 3 digit number on KB and press the space key, and it should
print out the number * 2 to the LCD.

Thanks for any help.

Rishi Dhupar
Hi rishi,
Verilog will never know what numbers you type in your keyboard. It's
just not there anymore when you have your hardware running. It's all
gates and FFs.

Now back to what you want to do...
It's the same thing as in your computer You get single characters from
your keyboard. But neither a number 1 nor the ascii code of "1", but a
scancode, you have to translate (if we are talking about common PS/2
keyboards).Anyway, let's just assume you have the number 1 in a register
and the number 2 in another register (or ram, whatever). If you want it
to become a number 12 ou have to multiply the 1 by 10 and add the 2.
It's called the decimal system. ;-)

You have to distinguish between numerical values for calculation and
chars for display purposes!

Now guess what you have to do when you do the multiplication and want to
display it?

have a nice synthesis
Eilert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top