Maker Pro
Maker Pro

Why Encoder circuits use OR logic gate and Decoder use AND?

Prohor

Sep 27, 2016
34
Joined
Sep 27, 2016
Messages
34
I am searching for answer why Encoder circuit uses OR logic gate to encode input to output and Decoder uses AND logical gate?

Can anyone help me with some explanation?
 

Alec_t

Jul 7, 2015
3,592
Joined
Jul 7, 2015
Messages
3,592
Which encoder?
Which decoder?
Schematics?
 

Alec_t

Jul 7, 2015
3,592
Joined
Jul 7, 2015
Messages
3,592
The Boolean logic will dictate which type of gate is used. In the case of the 8:3 priority encoder shown, only 3 4-input OR gates are needed. You could build the encoder using NAND gates, but I'm pretty sure you'd need a lot more gates.
 

Prohor

Sep 27, 2016
34
Joined
Sep 27, 2016
Messages
34
The Boolean logic will dictate which type of gate is used. In the case of the 8:3 priority encoder shown, only 3 4-input OR gates are needed. You could build the encoder using NAND gates, but I'm pretty sure you'd need a lot more gates.
Yes, I know as a universal logic gate both NAND and NOR can do the same circuit implemented. But I am still willing to know why in encoder OR gate is used instead of AND gate? I am a simple theory of my own like: as "Encoder has higher numbers of inputs like 8 x 3 , so or gate do the job as it sums . On the other hand Decoder like 3x8 has higher numbers of output so it requres AND gate as it has common character to multiplication - So that If I use OR gate in Decoder, it will give always smaller number of outputs instead of Greater numbers of output!!!" -- Is my theory ok?
 

Alec_t

Jul 7, 2015
3,592
Joined
Jul 7, 2015
Messages
3,592
I don't follow your theory or see how it relates to the truth table shown. How would you produce the 8:3 prority encoder using only AND gates?
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,752
Joined
Nov 17, 2011
Messages
13,752
The number of inputs or outputs has no relevance to the type of logic gates required to build a boolean function. Every boolean expression has an equivalent gate type to realize that expression in hardware.
boolean + = logic OR
boolean * = logic AND
booleant not = logic not

All other logic functions can be constructed from these 3 basic equivalences.
 
Top