HELP - FunBrain Magician on Logic Works

Thread Starter

Ali Akbar

Joined May 18, 2015
1
I need help with my project.
Here are the details. I need to implement it on logic works.


The FunBrain Magician is game that will pick a secret number between 0 – 31. User guesses what number it is. If the guess is high or low, FunBrain will give a hint.

User will ask the magician to generate the random number by setting input GRN = 1. Magician will take the guess after every 4 cycles. If the answer is correct CA will be set to 1, otherwise H or L will be set accordingly. In the end magician should tell in how many turns user is able to guess the correct number.




Input


Clock Pulse CP


Generate Random number GRN

Guessed Number C0…C4


Output


Correct Answer CA


Number of guesses D0…D4

High H

Low L
 

MrChips

Joined Oct 2, 2009
34,807
Do you know what is meant by successive approximation? This is also call a binary search algorithm.
For a number between 0 and 31, the most number of hints required would be 5.
For a number between 0 and 255, the most number of hints required would be 8.
 
Top