![]() |
|
|||||||
| Homework Help Stuck on a textbook question or coursework? Cramming for a test and need help understanding something? Post your questions and attempts here and let others help. |
|
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Hey guys.
I need to build a circuit that its input is a Byte and its output is the smallest pattern size. For example Input: 00000000 Output: 1 Input: 01010101 Output: 2 Input: 11011101 Output: 4 Input: 11111110 Output: 8 Any ideas guys? Thanks a lot. Assaf. |
|
#3
|
|||
|
|||
|
Quote:
I agree with you, it's not the most clear one. I wonder if I can build it with a FSM. I think they want some kind of a combinational circuit but If I wont find a solution, I guess I'll use some kind of memory with 256 memory units. |
|
#4
|
||||
|
||||
|
Quote:
Forget about building any kind of circuit. Firstly you have to define what you mean by "smallest pattern size." The description makes absolutely no sense. I would take it back to the teacher and ask him/her to restate the assignment.
__________________
Most computer problems can be attributed to a simple problem - a loosewire behind the keyboard. |
|
#5
|
|||
|
|||
|
Sorry, my mistake.
I meant the smallest repeated pattern size. I can't edit after 60 minutes apparently. |
|
#6
|
|||
|
|||
|
Quote:
Can you have a pattern that repeats with a shortest pattern length of 3? If not, why not and, consequently, which lengths are possible? Once you understand the answers to these questions, there are a couple of obvious ways to implement a circuit that answers the question. You can do it using nothing but combinatorial logic and it isn't that bad. You can also do it with a sequential circuit and it would be very simple to implement. |
|
#7
|
||||
|
||||
|
there are only few possible answers, instead of writing pattern recognition algorithm, why not just encode all possible outcomes?
output 1 is either for 00000000 or 11111111 output 2 is either for 10101010 or 01010101 etc. |
|
#8
|
||||
|
||||
|
FYI, after 10 posts you will be able to edit to your hearts content, this option was limited due to people erasing their homework questions. If it get abused the number count could be bumped up, or the feature eliminated entirely.
__________________
.. "Good enough is enemy of the best." An old engineering saying, Author unknown. General info: If you have a question, please start a thread/topic. I do not provide gratis assistance via PM nor E-mail, as that would violate the intent of this Board, which is sharing knowledge ... and deprives you of other knowledgeable input. Thanks for the verbage Wookie. |
|
#9
|
|||
|
|||
|
Quote:
However WBahn had a great idea and I think I'll use. Thanks a lot. Very helpful. Assaf. |
|
#10
|
|||
|
|||
|
Quote:
But the table you were talking about implementing and the table panic mode was leading you toward are two very different approaches. You were talking about encoding all 256 possible patterns. Since, by brute force, each byte could have a pattern length between 1 and 8, you would need a minimum of 3 bits for each byte (encode the patterns as 0 to 7 and always add 1), you would need 86 bytes of memory. The approach panic mode was taking (I may be going a bit further than he was thinking) was to see that there are only 2 bytes with a minimum pattern length of 1 and 2 bytes with a minimum pattern length of 2. As it turns out, there are only 12 bytes with a minimum pattern length of 4 and all the rest have a pattern length of 8. Thus you could use just 16 bytes of memory. You then search down the table to see if you find the input byte and, if you find it, based on the address of the entry in the table, you know what the minimum pattern length is. In my approach, which doesn't require any memory, you are actually doing something conceptually similar. |
|
| Tags |
| byte, pattern, size, smallest |
Related Site Pages
|
||||
| Section | Title | |||
| Worksheet | Analog-to-Digital conversion | |||
| Worksheet | Memory devices | |||
| Worksheet | Binary math | |||
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| USB Keyboard with PIC18F4550 | Dalaran | Embedded Systems and Microcontrollers | 4 | 09-01-2012 10:39 AM |
| i wanna USB HID mikroC Open source code | buffon2009 | Embedded Systems and Microcontrollers | 4 | 02-20-2012 09:49 AM |
| PIC Division (multiplication of inverse) | Pencil | Embedded Systems and Microcontrollers | 40 | 12-28-2011 05:33 AM |
| PIC code help | skuzzie | Homework Help | 3 | 03-02-2009 05:08 PM |
| keypad question | conanav | Embedded Systems and Microcontrollers | 9 | 06-28-2008 10:26 PM |
| Thread Tools | |
| Display Modes | |
|
|