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.

How to store integer string from keyboard on FPGA

Status
Not open for further replies.

koshmar29

Newbie level 4
Joined
Dec 15, 2014
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
36
Good evening,

I'm looking for a simple way to convert a sequence of keyboard strokes into a signed binary number I can use for processing. I understand how to convert scan codes into ascii/binary/bcd and how the keyboard works, but I'm having trouble when it comes to implementation. I'd like the input to be of unknown length--let's say up to 12 bits--and I'd like the input to be a signed whole integer, for simplicity. I tried searching for references, but I couldn't find anything specific to Verilog. In that regard, I'd greatly appreciate if anyone could give me advice on this matter.
 

First you have to convert the scan codes into the binary equivalent of the decimal number using a lookup table. That gets added to an accumulator. You'll need some method to clear the accumulator at the start of a new number. Each time you enter a new digit you will multiply the accumulator by 10 (too bad the number isn't hex) and add in the new number.

All of this should probably be contrrolled by an FSM.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top