-2

Ive a school project of building a logic circuit that counts the number of objects that passes through a checkout belt using 2 sensors.

Thing is: Tried to find something similar online (no luck) and I dont know how can I integrate those sensors because the displaying number for the objects is only changed on the 4th stage of this sequence: Starting from both sensors off 1- Sensor 1 on, sensor 2 off 2- Sensor 1 and 2 on 3- Sensor 1 off, sensor 2 on 4- Sensor 1 doenst matter (can be either on or off), sensor 2 off

Basically I want to know how can I apply this sequence on the circuit and I want to make it so when the signal is sent from the sensors, it activates the clock on my counter and adds 1 on the display (meaning I want the sensors to send one signal after the requirements are met)

Idk if table is right but its what I came up with Sensor1 Sensor2 Clock for Counter 1 0 0 1 1 0 0 1 0 X 0 1

then loops

P.s: Didnt add any reference image because it doesnt require any previous info othet than the sequence

Tried build something using the previous truth table and manually arranging the gates but no luck

Also tried to use an adder and a flip flop

expectations: not much

1 Answers1

0

Let your sensor inputs be i1 and i2, and we'll define outputs s1, s2, s3, s4 for the required stages of your sequence.

We can translate what you said directly into logic:

s1 = i1 & ~i2
s2 = (s1|s2) & i1 & i2
s3 = (s2|s3) & ~i1 & i2
s4 = (s3|s4) & ~i2

You can implement it just like this. s4 can be used as the clock for a counter.

The factors like (s1|s2) establish the required sequence and make a sort of flip-flop -- you can only be in s2 if you were already in s1 or s2. There needs to be enough propagation delay on the input from the previous stage to make sure that (s1|s2) doesn't turn off when s1 changes to s2.

Matt Timmermans
  • 53,709
  • 3
  • 46
  • 87