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.

Verilog Code Checking Characters inputted simultaneously

Status
Not open for further replies.

myfanwycat

Newbie level 4
Newbie level 4
Joined
Mar 1, 2011
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,330
Guys, I badly needed your help. I am a newbie to verilog and i have a problem with a certain exercise. Can anybody help me?

The problem goes like this:

A certain variable is already initialize with a value, in this case it would be "abc".
Then using 3 push buttons, the user will and must input the sequence correctly. In this case, the user must input "abc" simultaneously and correctly.
If the user will input "b" or "c" first, as in "bxx" or "cxx" respectively, it will result to display "E" as in error. Also if the user will input "acb" it would also be an error. Only "abc" is the correct format.


Please guys, help me..

I created a program in laravel to show you what I meant. If ever this could be of help, can you just convert this code to verilog? I badly needed you help guys.

Below is the code in laravel:
// array of sequence values
arr = ['a','b','c'];

// set current for initial value
current = 2; // array[current] evaluates to 'c'

for(;;) {
// get input and put to variable x
x = GETINPUT;

next = (current++ % array.length); // for first loop, next = (3%3) = 0 ; % is modulo
// compare x to the array
if(x == arr[next]) {
// TRUE
} else {
// ERROR
break;
}
}


Thanks a lot!..
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top