create account

Digital Electronics Series - Basics of Logic Gates by filler

View this thread on: hive.blogpeakd.comecency.com
· @filler · (edited)
$0.96
Digital Electronics Series - Basics of Logic Gates
# Building Devices with Logic Gates – Part 1

We all use various forms of computers in our daily lives. These computers contain various units such as the central processing unit and the arithmetic and logic unit.

At the heart of computer electronics, there are electronic components called logic gates, which control and transfer the flow of current. When used together, arrays of logic gates can achieve lots of useful functions such as mathematical operations such as addition, subtraction or multiplication.

Read on, so the next time you ask your computer what’s 1 + 1, you can really appreciate how the answer is calculated by using electronic components.

![P_20180706_215115.jpg](https://cdn.steemitimages.com/DQmb26H6eyorxVcF5cDsNHsix5xHswVtabrkEaBy9R8uWUA/P_20180706_215115.jpg)
 (I gave two inputs 01 and 01, i.e 1 + 1, The output is, as you can see with the LEDs lighted up, 10. Now 10 in binary is 2. The logic gates used together just added the two inputs and outputted their sum! How cool is that!)

Here, I tried to make a simple calculator using only logic gates. This is a Full Adder circuit, which takes two binary numbers as its input and displays the sum, in binary format. Binary format is very simple to learn and we will discuss it later.

## Logic Gates – The Basics

Logic gates are the most basic building blocks of digital electronics. They have inputs and outputs and the outputs are related to the inputs by a certain logic, which depends on the type of logic gate you are using. This will be discussed later when we look into the different types of logic gates.

The inputs of a logic gate can only have two values. It is either a 1 or a 0. Here, 1 is a high voltage and 0 is a low voltage. So 1 can mean 5 volts and 0, well, ground, or 0 volts. The neatness in using 1s and 0s is that you can represent numbers easily with 1s and 0s. Yes, I’m talking about the binary system of numbers. 

A binary number, at the most basic level, represents decimal numbers as sums of powers of two. 

We know that
> 5 = 4 + 1

> ie, 5 = 1 x 2<sup>2</sup> + 0 x  2<sup>1</sup> + 1 x 2<sup>0</sup> 

Therefore binary for 5 would be 101 

In a binary number, the left mot digit represents 2<sup>0</sup>, the 2nd digit from left 2<sup>1</sup> and so on. A 1 at the position of 2<sup>0</sup> indicates that there is a term of “1”(2<sup>0</sup>) in the number. A 0 at the 2nd position says that there is no 2(2<sup>1</sup>) and a 1 at the third digit indicates a 2<sup>2</sup> , that is 4. So the decimal number is the sum of all these numbers. That is , 4 + 0 + 1 = 5.

Neat isn’t it? 

Now we can study the different types of logic gates.

## 1.The NOT gate or the Inverter

This might be the simplest of the gates. It has only one input. As the name suggests, its an inverter. It inverts. If you give a 5v input, the output will be 0v. If you don’t give any input signal, you’ll get a 5v signal. Give a 1 and you get a 0, and vice versa.

![not.png](https://cdn.steemitimages.com/DQmNdGNhML9Q3LSecnB4UtzDFtdxjU8BJqsP9nGte7T3kCo/not.png)

## 2.OR gate

It has got n inputs and one output. As the name suggests, the output will be a 1 if any of the inputs are a 1. The output will be 0 only when all the inputs are 0.

![and.png](https://cdn.steemitimages.com/DQmP2dMn9C3ZSTSJQ2t4MsK3sT6qnwQqhSvgxQaXBJtxhAE/and.png)

## 3.AND gate

It has n inputs and an output. The output will be a 1 only when all the inputs are 1. In all the other cases, the output will be 0.

![realAnd.png](https://cdn.steemitimages.com/DQmeRbDKDvPwsLQtSedV3rNHn9E1wuEwBczqgnBKs4C5PAg/realAnd.png)

## 4.NOR gate

It is very similar to the OR gate, the only difference being, the output will be inverted. A NOR gate is equivalent to placing a NOT gate at the output of an OR gate. The output will be 1 only when all the inputs are 0. In all the other cases, the output will be 0.

![nor.png](https://cdn.steemitimages.com/DQmZdmqT3D77szqjnmQCwb2a2Q6VpdmcCZqxN7jKn6NBAT7/nor.png)

## 5.NAND gate

The NAND gate is to the AND gate, what NOR is to OR. NAND is just an inverted AND gate. The output of the AND gate, taken through a NOT gate.

![nand.png](https://cdn.steemitimages.com/DQmRrxUeFXVYe2xsyLmnB8waTsfvAo77gqmxcc1WMhyMpDC/nand.png)

## 6.Exclusive OR gate (XOR)

It is based on the OR gate. It is a logic gate with two inputs and an output. If any of the inputs (but not both), is 1, the output is 1. The output will be zero when both the inputs are 0 or 1.

![xor.png](https://cdn.steemitimages.com/DQmQ2qxGDEiNfgzMVX8HmNVcJ9GGk9mATcFpCZB9Pkuk4Tr/xor.png)

## 7.Exclusive NOR gate (XNOR)

It is based on the NOR gate. It has two inputs and an output. When both the inputs are either 0 or 1, the output is 1. When one of the inputs is 1 and the other 0, the output is 0.

![xnor.png](https://cdn.steemitimages.com/DQmNafohaqEMAr21hvCzjgumrfn9xyq44JfJqZDoRVRVAh3/xnor.png)


Now that we have learned about all the basic logic gates, let us further learn about how we can use these basic building blocks to build useful logic circuits that can do calculations and stuff for us. 

But after seeing all this you might wonder, “But what exactly are these ‘gates’?”

It’s a good question and I have wondered about it too. 

Logic gates are special circuits that are designed to realise the condition that we mentioned above while describing them. They are available in the form of integrated circuits, with multiple gates embedded onto them.

For example, take a look at these : - 

![P_20180707_160243.jpg](https://cdn.steemitimages.com/DQmdH6an2pPCUHgfn8Vb6raFrGwRdFD1zqhDGUrnqrG736k/P_20180707_160243.jpg)

![P_20180707_160254.jpg](https://cdn.steemitimages.com/DQmcLHSLQPM9f3N7gbSTEjhxWaG1BBvqCztN4qoysxi1XaV/P_20180707_160254.jpg)

![P_20180707_160309.jpg](https://cdn.steemitimages.com/DQmZtV6QdSKqUy4WgUmmXBENjTmrBFdAUUKwJ5unVE4uTCG/P_20180707_160309.jpg)


![P_20180707_160345.jpg](https://cdn.steemitimages.com/DQmRiU2dAnf3fxxHJvpCwX6wRs7zz1zczZULksiHqr7Fscu/P_20180707_160345.jpg)

![P_20180707_160336.jpg](https://cdn.steemitimages.com/DQme123hmSou2BWTQVf3QaLjPuAdWjh6SqH4uVq5cEP2P3m/P_20180707_160336.jpg)




Independently, any logic gate can be made from transistors. I’ll talk about this in an entirely different article. It is the same configuration of transistors that are used while designing and fabricating the ICs. In fact, you can create each and every logic gate by yourself using only transistors. It can be fun to experiment and learn, but for all the projects that we do in digital electronics, we will be using the gates available in chips only. They are much compact and are easier to use and debug in our circuits.

That’s the end of first part of the Digital Electronics series! Tell me what you think about this and stay tuned for the upcoming articles!

### Image Source
 All the images shown are made/taken by me.

## Proof of work :- 
![P_20180707_160421.jpg](https://cdn.steemitimages.com/DQmRUJv2nZ65hgzCjxtMvcxkhJu5ynKnxRqPqdi1FhrF6bC/P_20180707_160421.jpg)
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
properties (23)
authorfiller
permlinkdigital-electronics-series-basics-of-logic-gates
categorysteemstem
json_metadata{"tags":["steemmakers","steemstem","steemiteducation","electronics","diy"],"image":["https://cdn.steemitimages.com/DQmb26H6eyorxVcF5cDsNHsix5xHswVtabrkEaBy9R8uWUA/P_20180706_215115.jpg","https://cdn.steemitimages.com/DQmNdGNhML9Q3LSecnB4UtzDFtdxjU8BJqsP9nGte7T3kCo/not.png","https://cdn.steemitimages.com/DQmP2dMn9C3ZSTSJQ2t4MsK3sT6qnwQqhSvgxQaXBJtxhAE/and.png","https://cdn.steemitimages.com/DQmeRbDKDvPwsLQtSedV3rNHn9E1wuEwBczqgnBKs4C5PAg/realAnd.png","https://cdn.steemitimages.com/DQmZdmqT3D77szqjnmQCwb2a2Q6VpdmcCZqxN7jKn6NBAT7/nor.png","https://cdn.steemitimages.com/DQmRrxUeFXVYe2xsyLmnB8waTsfvAo77gqmxcc1WMhyMpDC/nand.png","https://cdn.steemitimages.com/DQmQ2qxGDEiNfgzMVX8HmNVcJ9GGk9mATcFpCZB9Pkuk4Tr/xor.png","https://cdn.steemitimages.com/DQmNafohaqEMAr21hvCzjgumrfn9xyq44JfJqZDoRVRVAh3/xnor.png","https://cdn.steemitimages.com/DQmdH6an2pPCUHgfn8Vb6raFrGwRdFD1zqhDGUrnqrG736k/P_20180707_160243.jpg","https://cdn.steemitimages.com/DQmcLHSLQPM9f3N7gbSTEjhxWaG1BBvqCztN4qoysxi1XaV/P_20180707_160254.jpg","https://cdn.steemitimages.com/DQmZtV6QdSKqUy4WgUmmXBENjTmrBFdAUUKwJ5unVE4uTCG/P_20180707_160309.jpg","https://cdn.steemitimages.com/DQmRiU2dAnf3fxxHJvpCwX6wRs7zz1zczZULksiHqr7Fscu/P_20180707_160345.jpg","https://cdn.steemitimages.com/DQme123hmSou2BWTQVf3QaLjPuAdWjh6SqH4uVq5cEP2P3m/P_20180707_160336.jpg","https://cdn.steemitimages.com/DQmRUJv2nZ65hgzCjxtMvcxkhJu5ynKnxRqPqdi1FhrF6bC/P_20180707_160421.jpg"],"app":"steemit/0.1","format":"markdown"}
created2018-07-07 11:54:36
last_update2018-07-09 12:18:06
depth0
children6
last_payout2018-07-14 11:54:36
cashout_time1969-12-31 23:59:59
total_payout_value0.792 HBD
curator_payout_value0.170 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length6,981
author_reputation4,924,532,976,740
root_title"Digital Electronics Series - Basics of Logic Gates"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id63,772,285
net_rshares480,514,299,873
author_curate_reward""
vote details (32)
@ceruleanblue · (edited)
My lady got me a raspberry pi for Christmas, and I've been aiming to get int the hardware aspect of this. Very informative post! Will be keeping an eye out for you in the future :)
👍  
properties (23)
authorceruleanblue
permlinkre-filler-digital-electronics-series-basics-of-logic-gates-20180710t165036349z
categorysteemstem
json_metadata{"tags":["steemstem"],"app":"steemit/0.1"}
created2018-07-10 16:50:39
last_update2018-07-10 16:50:48
depth1
children0
last_payout2018-07-17 16:50:39
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length180
author_reputation3,400,370,914,590
root_title"Digital Electronics Series - Basics of Logic Gates"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd0
post_id64,184,124
net_rshares976,451,836
author_curate_reward""
vote details (1)
@princluv ·
Great post...but i didnt know much on that. Keep it up, anyway!
properties (22)
authorprincluv
permlinkre-filler-digital-electronics-series-basics-of-logic-gates-20180708t020513398z
categorysteemstem
json_metadata{"tags":["steemstem"],"app":"steemit/0.1"}
created2018-07-08 02:05:12
last_update2018-07-08 02:05:12
depth1
children0
last_payout2018-07-15 02:05:12
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length63
author_reputation722,900,354,816
root_title"Digital Electronics Series - Basics of Logic Gates"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id63,843,663
net_rshares0
@saintopic ·
I remember this back then in school, it was alway an interesting class and way the lectural explain the gates are cool.
👍  
properties (23)
authorsaintopic
permlinkre-filler-digital-electronics-series-basics-of-logic-gates-20180707t124350880z
categorysteemstem
json_metadata{"tags":["steemstem"],"app":"steemit/0.1"}
created2018-07-07 12:43:54
last_update2018-07-07 12:43:54
depth1
children0
last_payout2018-07-14 12:43:54
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length119
author_reputation494,228,895,348
root_title"Digital Electronics Series - Basics of Logic Gates"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd0
post_id63,776,753
net_rshares815,337,283
author_curate_reward""
vote details (1)
@sayee ·
good work there, keep it up
👍  
properties (23)
authorsayee
permlinkre-filler-digital-electronics-series-basics-of-logic-gates-20180707t115835927z
categorysteemstem
json_metadata{"tags":["steemstem"],"app":"steemit/0.1"}
created2018-07-07 11:58:45
last_update2018-07-07 11:58:45
depth1
children0
last_payout2018-07-14 11:58:45
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length27
author_reputation400,854,996,823,619
root_title"Digital Electronics Series - Basics of Logic Gates"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id63,772,618
net_rshares893,453,429
author_curate_reward""
vote details (1)
@steemitboard ·
Congratulations @filler! You have completed the following achievement on Steemit and have been rewarded with new badge(s) :

[![](https://steemitimages.com/70x80/http://steemitboard.com/notifications/votes.png)](http://steemitboard.com/@filler) Award for the number of upvotes
[![](https://steemitimages.com/70x80/http://steemitboard.com/notifications/comments.png)](http://steemitboard.com/@filler) Award for the number of comments

<sub>_Click on the badge to view your Board of Honor._</sub>
<sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP`</sub>


To support your work, I also upvoted your post!


**Do not miss the last post from @steemitboard:**
[SteemitBoard World Cup Contest - Russia vs Croatia](https://steemit.com/steemitboard/@steemitboard/steemitboard-world-cup-contest-russia-vs-croatia)

---
**Participate in the [SteemitBoard World Cup Contest](https://steemit.com/steemitboard/@steemitboard/steemitboard-world-cup-contest-collect-badges-and-win-free-sbd)!**
Collect World Cup badges and win free SBD
Support the Gold Sponsors of the contest: [@good-karma](https://v2.steemconnect.com/sign/account-witness-vote?witness=good-karma&approve=1) and [@lukestokes](https://v2.steemconnect.com/sign/account-witness-vote?witness=lukestokes.mhth&approve=1)

---

> Do you like [SteemitBoard's project](https://steemit.com/@steemitboard)? Then **[Vote for its witness](https://v2.steemconnect.com/sign/account-witness-vote?witness=steemitboard&approve=1)** and **get one more award**!
properties (22)
authorsteemitboard
permlinksteemitboard-notify-filler-20180707t135247000z
categorysteemstem
json_metadata{"image":["https://steemitboard.com/img/notify.png"]}
created2018-07-07 13:52:45
last_update2018-07-07 13:52:45
depth1
children0
last_payout2018-07-14 13:52:45
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,539
author_reputation38,975,615,169,260
root_title"Digital Electronics Series - Basics of Logic Gates"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id63,783,470
net_rshares0
@steemmakers ·
<div class='pull-right'><center><a href='http://www.steemmakers.com'><img src='https://www.steemmakers.com/img/comment_logo_makers.png' /></a></center></div><b>Congratulations</b> This post has been upvoted by SteemMakers. We are a community-based project that aims to support makers and DIYers on the blockchain in every way possible. <br/><br/>Join our <a href='https://discord.gg/EFGbRuW'>Discord Channel</a> to connect with us and nominate your own or somebody else's posts in our review channel.<br/><br/><b>Help us to reward you for making it !</b> Join <a href='https://www.steemmakers.com/#/Trail'>our voting trail</a> or <a href='https://www.steemmakers.com/#/Delegation'>delegate steem power</a> to the community account. <br/><br/>Your post is also presented on the community website <a href='http://www.steemmakers.com'>www.steemmakers.com</a> where you can find other selected content. <br/><br/>If you like our work, please consider upvoting this comment to support the growth of our community. Thank you.
properties (22)
authorsteemmakers
permlinkre-filler-digital-electronics-series-basics-of-logic-gates-20180709t085436377z
categorysteemstem
json_metadata""
created2018-07-09 08:54:24
last_update2018-07-09 08:54:24
depth1
children0
last_payout2018-07-16 08:54:24
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,019
author_reputation1,907,312,584,548
root_title"Digital Electronics Series - Basics of Logic Gates"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id64,001,710
net_rshares0