# State Machine for SSD help

Discussion in 'Homework Help' started by thePHAN, May 31, 2011.

1. ### thePHAN Thread Starter New Member

May 30, 2011
14
0
Hi guys my 1st post here

i got an problem where i have a SSD and i want it to display "----0001" then
than "1---0001" -> "11--0001" -> "112-0001" - > "11240001"

but if i input a wrong display will remain as a "-" so for example this is what is displaying 1---0001 - > 13--0001 (wrong) -> 1---0001

does my "-" count as a state? or i can preset them to be "-" in which i dont know how to do

so i made a state diagram and i would like to confirm if these are viable if not would some one teach me or link me to something that would teach me how it should look like.

for the second picture green arrow means wrong input set back to "-" red arrow means "correct input" blue arrow means "correct input move next state" i used 3 arrows so that when i do get a wrong input on the 3rd or 4th state what ever i state that was inputed before them would remain as it is and not reset to "-"

File size:
91.2 KB
Views:
24
File size:
85.4 KB
Views:
26
2. ### thePHAN Thread Starter New Member

May 30, 2011
14
0
another state table i made is x=1 "-" -> "1" -> "1" -> "2" -> "4" if x=0 then all states lead back to "-"

3. ### thePHAN Thread Starter New Member

May 30, 2011
14
0
ok so i made a table for my previous post and i got

S1|S2|S3|-|N1|N2|N3|-|Output|

000 - 001 - 0001
001 - 010 - 0001
010 - 011 - 0010
011 - 100 - 1000
100 - 101 - 1010 (initial state for all states)

here are my equations S#' means "not"

N1= S1+S3.S2
N2 = S3.S2'+S2.S3'
N3 = S3'

after this i still have some questions

1st problem is how do i make my out put N1= Binary output (do i use a decoder?)
2nd problem is let say i do make my logic circuit what do my inputs connect to?

now that i did the sequence circuit how do i make it recognise my binary as the correct out put ?

how do i set my first for numbers to dashes "-" ?

also heres a pic of my sequence circuit if theres anything wrong with it please do correct me

File size:
94.3 KB
Views:
25
4. ### Georacer Moderator

Nov 25, 2009
5,151
1,266
This is not so straightforward as it seems. First we have to clear up where you will display your output. What do you mean by SSD? Did you mean a one-line LCD possibly, or an array of 7-segments? What will drive it?

Do you have to read your input from a keypad, a set of binary switches or a keyboard? All of that information is vital to the extraction of the solution.

5. ### thePHAN Thread Starter New Member

May 30, 2011
14
0
sorry bout that let me clear it up then.

what im required to do is using a DSX experimenter module here's a pic, is to be able to input the number 1124 from it's locked state ----0001, using the rotary hex switch and a button.

the second part is if the user inputs the numbers wrong 3 times it will sound an alarm and freeze my board for 20 seconds

i'm not sure what kind of SSD it is but i'm sure the picture will inform you.

Also here is another picture of my schematics on xilinx so far the numbers atm are hard wired to 0 - 1 (Vcc and GND) i want to move forward to implementation of my rotary hex switch which i think goes into my multiplexer and then be able what i mentioned previously.

File size:
46.3 KB
Views:
20
File size:
100.8 KB
Views:
23
6. ### Georacer Moderator

Nov 25, 2009
5,151
1,266
Since you have a microcontroller in your hands, you are far better off if you make a program to simulate through high-level logic your FSM. Don't try to think about your problem in FSM terms. You have an input of at least 3 bits and 4 states and these specs will result in a chaotic transition table.

Just write a software that will run on you uC, reading the inputs, looking at its memory and driving its outputs accordingly.

7. ### thePHAN Thread Starter New Member

May 30, 2011
14
0
another question for whoever can answer if i have a string of numbers

0001000100100100 <- that shows 1124

but for it to be implemented in a circuit does each individual binary code need to be separated so it has it own state?

0001
0001
0010
0100

8. ### thePHAN Thread Starter New Member

May 30, 2011
14
0
i don't quite understand Georacer but, the assignment requires me to use schematics and i would also have to use FSM counters decoders MUX counters and registers flipflops and the whole shabang for this assignment.

9. ### Georacer Moderator

Nov 25, 2009
5,151
1,266
Ok, since you insist on building an FSM, you first must have an idea of what you 're up to.
Take a glance here, especially on the transition tables to see what you will have to build:

The lines of the transition table are $2^{input bits+state bits}$, and the table must be filled.

If you read the input 4 bits at a time you have to use at about 4 or 5 states, which can be encoded with 3 bits. Your table will have 2^7=128 lines.
If you read the input bit by bit serially, you will have to use at about four times as many states, which ends up with at least 20 states. 5 bits are needed to encode them. Your table will have 2^5=32 lines. That kinda looks feasible, but it is very hard to build a coherent and complete transition diagram for this particular problem.

If you still feel up to it, read the tutorial carefully and post a transition diagram for proofreading.

My suggestion was to program the uC of your board with a software that would follow an "if...then...else" logic in order to take action after each input read.

10. ### thePHAN Thread Starter New Member

May 30, 2011
14
0
hmmm i never knew it would be 32 lines ... is there any other possible way for me to be able to select my numbers using the SSD switch with out FSM but still using Gates to solve the problem? from what ive heard my class mates are using Sequence recognizer or Registers for this problem? any ideas?

11. ### thePHAN Thread Starter New Member

May 30, 2011
14
0
ill post the assignment file up actually might help who ever tying to help me ahhaha

File size:
392.9 KB
Views:
40
12. ### Georacer Moderator

Nov 25, 2009
5,151
1,266
I can't seem to find any real specs about that kit of yours. I understand it has a PIC inside it, but what else lies there, besides the peripherals? There is an FPGA in there too, right?

I see that you are stuck in the phrase "sequence recogniser", but out of context that could mean anything. A PIC source code could be just as good. I don't see any discrete parts FSM solution required, and you would need an FPGA for that.
You would do yourself a great favour if you asked your tutor about the nature of the solution.

What I am proposing (once again) is to program the PIC in order to read input from the HEX switch every time Enter is pressed.
Make some if tests to determine whether you have input the right sequence or not. Increase a counter to count the wrong inputs and when it reaches three, terminate the program.

Can you handle the programming? I can only help you with a code diagram, I don't know the PIC language or how to handle your kit.

13. ### thePHAN Thread Starter New Member

May 30, 2011
14
0
I dont know the specs of my own board either hahahahha

but i do have the assembly manual which have the specs but im a noob at electronics just started doing digital circuits and electronics, so i got know idea what these specs are

PIC 16f877a
CPLD 9572XL

i asked him the PIC source code is allowed for the part since it dint specify a specific way to do it. but the thing is i font know where to start now since, i'm completely new at pic but! i have 5 days to do it and ill be spending a minimum of 6 hours a day on this dam assignment so any thing at all that could help me learn to finish this assignment would be helpful.

File size:
2.4 MB
Views:
95
14. ### thePHAN Thread Starter New Member

May 30, 2011
14
0
here another file that might help

File size:
108.4 KB
Views:
26

May 30, 2011
14
0
and another.

File size:
1 MB
Views:
11