Line follower robot using max 8 NAND gates

391 Views Asked by At

So I have to figure out the logic for a line follower robot using at maximum 8 NAND gates (2 7400HC series NAND circuits).

The robot has 3 sensors, which give 1 on a black surface and 0 on a white surface. The robot has 2 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 and "RM" for Right Motor.

\begin{array}{|c|c|c|c|} \hline A& B & C & LM & RM \\ \hline 0 & 0 & 0 & 0 & 0 \\ \hline 0 & 0 & 1 & 1 & 0 \\ \hline 0 & 1 & 0 & 1 & 1 \\ \hline 0 & 1 & 1 & 1 & 0\\ \hline 1 & 0 & 0 & 0 & 1 \\ \hline 1 & 0 & 1 & 1 & 0\\ \hline 1 & 1 & 0 & 0 & 1\\ \hline 1 & 1 & 1 & 1 & 1\\ \hline \end{array}

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.

\begin{array}{|c|c|c|c|} \hline LM& & AB \\ \hline && 00 & 01 & 11 & 10 \\ \hline C& 0 & 0 & 1 & 0 & 0 \\ \hline & 1 & 1 & 1 & 1 & 1 \\ \hline \end{array}(Sorry for the scuffed K-map)

From which I got the function

F=C+A´B

Then the K-Map for the right motor.

\begin{array}{|c|c|c|c|} \hline RM&& AB & \\ \hline && 00 & 01 & 11 & 10 \\ \hline C&0& 0 & 1 & 1 & 1 \\ \hline &1& 0 & 0 & 1 & 0 \\ \hline \end{array}

And the function

F=BC'+AC'+AB

I have two main problems.

  1. How do I use De Morgans laws to convert these functions to use NAND gates only? I don't quite understand them.
  2. How do I combine these two boolean functions? Does that come naturally after converting the individual functions to use NAND gates?
1

There are 1 best solutions below

1
On

Using Logic Friday 1, I generated three solutions:

enter image description here

enter image description here

enter image description here

Sadly, none of them fits in two 4 x NAND2 ICs.

Is it possible to revise the truth table to make it simpler? What purpose do the three sensors have?