I'm stuck on this and would appreciate some pointers.
So for class I have to figure out the logic for a line follower robot using at maximum 8 NAND gates (two 74HC00 Quad NAND ICs).
The robot has three sensors, each of which gives logic 1 when on a black surface and logic 0 on a white surface. The robot has two motors, one on the left and one on the right.
Below is the truth table I have made: A, B and C for the individual sensors; LM for Left Motor; RM for Right Motor.
My aim is that the robot tries to get the black line either under sensor B or, when the line is wide enough, under all sensors.
Next I made the K-Maps for both motors. Left motor first.
From which I got the function
F=C+A'B
Then the K-Map for the right motor.
And the function
F=BC'+AC'+AB
I tried creating each AND, NOT and OR gate using NAND using this but I quickly run out of NAND gates.
So, I have two main problems.
- How do I convert these functions to use NAND gates only, without exceeding the NAND limit?
- How do I combine these two Boolean functions in order to make the motors work according to the logic table, without running out of NAND gates?
Do I simply have to sacrifice some of the functions in order to require fewer gates?