Best place for beginners to learn electronics from basic science to Internet of Things.

Embedded System

An embedded system is a combination of small computer hardware embedded with its operating system and application designed to perform a specific task.

Artificial Intelligence

AI refers to simulation of human intelligence through a piece of software code that has capability to learn and act like a human brain.

Machine Learning

ML is an application of Artificial Intelligence that gives a machine the ability to learn new things from experience and take decisions, without need to change the program inside it.

Internet of Things

IoT is a new buzz around us since last few years, which aims at connecting anything and everything around us to the internet. Upcoming 5G technology and IP version-6 will be extremely helpful in achieving this.

5G Technology

5G wireless technology is meant to deliver higher multi-Gbps peak data speeds, ultra low latency, more reliability, massive network capacity, increased availability, and a more uniform user experience to more users.

Thursday, June 3, 2021

How to make a wireless Oximeter?

During this Covid-19 pandemic oximeters are in high demand and so there are many different manufacturers making oximeter to supply in the market. At the same time many hobbyist are also searching on web how to make an oximeter at home itself. There are many circuits available on web which uses an Arduino board, a Max30100 series sensor and an OLED screen to display the values. Some are based on ESP8266 wherein the data is pulled on Blynk application etc. 

Here we will make an ESP8266 based oximeter using Max30102 sensor and an android application which can be installed on android mobile and data from sensor will be directly visible on your mobile phone via wi-fi link, no internet required. This makes it easier for patient’s family member to know his/her condition remotely within wi-fi range, without going near the patient. This is also an example of IoT(Internet of Things) implementation. You may check out this link for more detailed information on Internet of Things. Sample output on android application is shown here with connection diagram.

Let us see, how we can make this project and use at home. Being a homemade gadget we do not recommend using it for medical purpose though it shows almost same result as those cheaply available in market. This displays Oxygen level, average heart beat and temperature. 

ESP8266 Oximeter

Parts Required

  • ESP8266 NodeMCU board or ESP12 board
  • MAX30102 (heartbeat, oxygen and temperature sensor)
  • Android mobile (to load application)

Other one time requirements to program ESP are:

  • PC or laptop with Arduino application loaded
  • USB cable to connect NodeMCU to program

The arudino code can be downloaded from here.
All the required libraries in the beginning of the code should be installed in arduino software which is installed in the PC.

“MAX30105.h” and “heartRate.h” are both included in “SparkFun_MAX3010x_Sensor_Library-master”. This library can be downloaded from github.com from this link - https://github.com/sparkfun/SparkFun_MAX3010x_Sensor_Library

Those who are new to arduino programming may checkout multiple tutorials available on web to setup arudino software and how to add new libraries in zip format. The ESP8266 NodeMCU consist of USB to serial converter chip (CP2102 or CH340/341) for which again we should have driver installed in PC so that nodemcu can get detected as a particular com port.

We can make this oximeter using NodeMCU (as shown in first diagram above) which is the easiest way as programming nodemcu is very easy as no additional external components are required.  Just plug the USB cable, setup the com port number in arduino software and upload the program. After programming only four connecting wires are required to connect the MAX30102 sensor module with ESP board i.e. +3.3V, Gnd, SCL and SDA. Rest all pins of sensor and ESP boards are to be left open. The ESP board gets the power from USB cable connected to it and PC. Once programmed, we can disconnect the USB cable from PC and connect to any mobile charger outlet having 5V output. 


How it works?

  • The ESP8266 board is programmed to work as mini web server in AP (Access Point) mode with SSID – “Oximeter” and password “12345678”.
  • The moment power is applied to ESP board, it runs the program loaded on it and the server and access point starts.
  • ESP board then initializes the sensor with set parameter to turn on Red LED and IR LED built in it. If the red LED in sensor doesn’t glow after 1-2 seconds of powering ON the setup, then there is some error. Check the connections and reset the ESP board or recycle the power source.
  • Once the RED light is visible on sensor, your hardware setup is ready with program loaded on it.

Now download the android application APK file from here and install on your mobile.


Switch on wi-fi on your mobile phone, you should be able to see wi-fi with SSID – “Oximeter”. Connect to it and when prompted for password, enter “12345678” and connect. The mobile will connect to this wi-fi with limited connectivity w/o internet as it is not required and not enabled in ESP8266.


Once connected to this wi-fi SSID, open the application on your mobile and you should get the output on screen as shown in below screen shots.


Types of message received on application.


ESP Oximeter Android Application

Message 1:Check Oximeter power and your wifi connection. For further help check below, “How to setup EspOximeter” – This error is received when no wifi or internet connection detected on mobile.

If the mobile is connected with any other connection other than “Oximeter”, then in this case you will get only white screen with no message.

Message 2:Finger not detected” – This message comes if all setup is OK, your mobile is connected with correct SSID and sensor is also active but unable to sense any finger on sensor.

Message 3:Reading data” – This means that the oximeter has sensed finger in front of it and is reading the data. Hold your finger stable on sensor for few seconds so that the reading is stabilized.
 
Here it will show oxygen level, average heart beat and your body temperature in Fahrenheit. The web server is programmed with small piece of java script so that it can keep sending real time data on screen automatically without refreshing the screen.

Note: In case the screen seems to be freez and not changing, you may click on refresh button and check again. Your ESP8266 based Oximeter is ready now.
 
There is other smaller version of ESP8266 board i.e. ESP12 which can also be used to make this Oximeter as it has the SDA (Serial Data) and SCL (Serial Clock) pins. Only thing is that it requires additional setup for programming and running the device. There are many methods to program the ESP12 but I prefer below setup.

ESP12 Programming
All additional components are required as shown in diagram so that the ESP12 module boots in flash mode. On the left we have ESP12 module and on right we have NodeMCU board. After making this temporary arrangement on breadboard, plug the USB cable on NodeMCU and program in the same way thru Arduino software. Code will be same for ESP12 also, without any change.

ESP12 Oximeter
Once programmed below setup can be used to run the oximeter, but care has to be taken to provide external regulated DC power supply of 3V to 3.6V, as ESP12 operates between these voltages. The sensor module can run from 1.8V to 5V hence 3.3V external supply will support both. Again few external components are required to be wired around ESP12 so that it can now boot from flashed program. All resistors are 10K 1/4 watt and capacitor is 0.1uf or 104. Capacitor is used here to give power on reset pulse to ESP12 board.

You may like to buy ESP8266 from here.

Buy MAX30102 sensor module from here.

And buy ESP12 module from here.


Share:

Saturday, January 23, 2021

How timer IC 555 works?

In this topic we will learn about very basic and multipurpose timer IC 555 and how it can be used for implementing different timer operations. This is a cheap and easy to handle chip which most of the hobbyist use during their initial phase of learning electronics. Lot of different projects can be made using this IC just by connecting few components around it. It comes in 8-pin DIP (Dual in Line Pin) plastic package.  It is mostly used in timer applications hence commonly known as 555 timer IC.

IC555 internal block diagram
Let us look at the internal block diagram of this timer IC. It comprises of a voltage divider circuit built around three 5KΩ resistors. It is then followed by two operational amplifiers working as voltage-comparator. The output of operational amplifiers are fed to SR Flip-Flop and the output is fed out through an inverting circuit and a discharge transistor is also connected to flip flop output to discharge the timing capacitor connected to IC pin for timer applications. As we have already learned about all these basic building blocks in previous topics, hence it should be easy to understand the functionality of this IC at this stage. This is the reason I have arranged the topics in this sequence.

Operation:

Positive supply voltage is provided to Pin-8 and negative (Gnd) to Pin-1. Recommended voltage as per data sheet of LM555 is minimum 4.5V to a maximum of 16V. Let us assume we connect it to 12V DC supply.  Looking at the voltage divider circuit, whatever supply we give between Pin-8(Vcc) and Pin-1(Gnd) is divided in three equal parts as all the resistance are equal i.e. 5KΩ. Pin-4 is connected to Vcc as it is active low reset pin for SR Flip-Flop, hence if left open or low, it will always keep the flip-flop in reset state and hence no change will happen to its output pins.

  • Hence at the junction of middle and bottom resistance the voltage is 1/3rd of supplied voltage (Vcc). This is fed to inverting input of bottom op-amp hence work as reference voltage for it. This comes out to be 4V (for 12V supply).
  • And similarly the voltage at junction of top and middle resistor the voltage comes out to be 2/3rd of supplied voltage (Vcc). This is fed to non-inverting input of top op-amp hence act as reference voltage for it. This comes out to be 8V (for 12V supply). This junction is also given out as Pin-5 (control voltage) which can be used to apply external voltage to control the width of pulse generated by this timer. This we will see going further.
  • If any voltage lower than 1/3Vcc is applied on Pin-2 (Trigger), output of lower op-amp is ZERO (Low) which is connected to ‘R’ input of flip-flop, hence the output of Flip-Flop Q=1 and Q’=0. Since the output Q’ is inverted and then taken as output at Pin-3, hence the state of Pin-3 is HIGH (Reverse of Q’). This state remains till ‘S’ input is made ZERO (Low). Since voltage at this Pin has triggered the output pin as HIGH, hence is called Trigger pin.
  • When a voltage higher than 2/3rd of Vcc is applied at Pin-6 (Threshold) the ‘S’ input goes low hence the state of Q’ changes to ‘1’ and hence its inverted state at Pin-3 is ‘0’. Since voltage above 2/3rd Vcc changed the output state to Low hence this pin is also called as threshold pin.
  • Now if we want to change the threshold and trigger voltage levels for a fixed supply at Pin-8, we can give additional supply at Pin-5 (Control Voltage). This additional voltage will get added to the reference voltages hence the will change the limits for trigger and threshold pin at which the output state changes. That’s the reason this pin is called control voltage. This can be used to modulate the pulse width at output pin or for modulating the pulse at output based on voltage variation at Pin-5. During normal operation this pin is bypassed with small capacitor (0.01µf) to avoid any interference with external voltages.
  • Pin-7 is called discharge pin and is used to discharge the timing capacitor connected to this IC when used in timer mode. This we will understand better when we will see its application.
IC555 Pin out diagram
The pin out diagram of this timer IC is as shown here. Ground, Trigger, Output and Reset pins are on one side and Vcc, Discharge, Threshold and Control Voltage pins are on the other side.

Astable Multivibrator using LM555 IC: 

Let us learn about the basic application of this IC as astable multivibrator. It’s called multivibrator as the output changes its state from high to low and low to high. And Astable means both these states are not stable, they keep changing. There is another mode called Monostable where one (Mono) state is stable and the other is temporary. This we will see in next topic.

IC555 Astable Multivibrator

In this circuit we have connected resistor R1 between Vcc and pin-7(discharge) and R2 between pin-7 and pin-6(threshold). Trigger(2) and threshold(6) pins are connected together which is connected to a capacitor through negative supply.

Assume diode D1 is not connected now, later we will see the impact of connecting this diode across R2. That is the reason this is connected with dotted line. Also C2 is optional as it will not impact much in test environment but during practical implementation this is recommended to bypass control voltage(5) to ground or negative of supply. Usually we use a 0.01µf capacitor.

To simplify the understanding of the operation, you can take help of this graph.

IC555 Astable Multivibrator Graph
Step-1: Initially when we power this circuit, the capacitor C1 is fully discharged hence the voltage across it is zero hence trigger and threshold pins are at zero voltage (tagged as VC1 in the circuit). This pushes output at pin-3 as high and the hence the discharge transistor inside IC is OFF. Capacitor C1 start charging through resistor R1 and R2 as mentioned in graph as “First Charging Cycle”. The output remains high till the voltage at Vc1 just crosses 2/3rd Vcc.

Step-2: As the voltage at Vc1 reaches just more than 2/3rd Vcc, the output state of IC changes to low and the discharge transistor inside IC turns ON. This forces the charge on capacitor to start discharging through resistor R2 and through transistor to ground and this continue till the voltage across capacitor (Vc1) reaches just below 1/3rd Vcc. This triggers the output again to high and the discharge transistor is turns OFF hence again the voltage across capacitor reaches just above 2/3rd Vcc. And this cycle repeats till the power is supplied to the circuit.

Here we can see that while charging there are two resistors (R1 & R2) coming in charging path and while discharging only R2 comes in discharge path.
So the time taken for charging can be calculated as t1 = 0.693 X (R1+R2) X C1 sec.
And the time taken for discharge can be calculated t2 = 0.693 X R2 X C1 sec.
That is the reason the time period for which the output remains HIGH is more and the time period for which the output remains LOW is less.

If we want both the times to be equal, we need to any way make the resistance in charging path and in discharging path equal. To do this we use same value of R1 and R2 i.e. R1 = R2 = R and we can connect the diode D1 in parallel to R2 as shown in circuit diagram with dotted line.

Although practically the forward biased resistance of a diode is note ZERO, but considering theoretically ZERO, the resistance R2 act as short during charging cycle as D1 is forward biased. Hence charging time t1 is nearly equal to 0.693 X R X C1 (as we have taken R1 = R2 = R).

While discharging, the diode D1 is reversed biased hence the discharging current flows through resistance R2 which is equal to R.

So the discharging time t2 is also equal to 0.963 X R X C1. In this condition t1 = t2 hence the pulse width of for ON time = pulse width for OFF time. Hence theoretically we will get a square wave of 50% duty cycle. Though there are other ways to create square wave with perfect 50% duty cycle, but this is very basic method hence we covered here.

Checkout this video to see the simulation of astable multivibrator using IC555. We have connected a Yellow LED at the output pin to see the HIGH and LOW status of the output. LED turns ON when output is HIGH and goes OFF when output is LOW. A voltage tag is placed at timing capacitor 5µf, you can see at what voltage level the state of output changes. This shows the charging and discharging cycle. You can also see the direction of flow of current through capacitor during charging and discharging cycle.


We will see the other modes of timers in upcoming topics. Keep visiting…

Share:

Friday, January 1, 2021

What are Flip Flop circuits?

Hello there, it has been a long time I haven’t posted new topic as I was stuck in some new project. Next topic here is Flip Flop circuits, their types and uses in digital electronics. 

Flip Flop is a circuit that has two stable digital states i.e. logic-1 or HIGH and logic-0 or LOW. The status can be flipped between ‘0’ and ‘1’ by changing the digital status at input side. They can be used to store digital information. It has input side that takes different sets of logic input and clock signal and has two outputs. One output is complement of other i.e. if one is at HIGH state the other will be at LOW state and vice-e-versa. These outputs are mostly denoted by ‘Q’ and other as a hyphen on Q or Q', but that’s not mandatory, any alphabet can be used. The status of output pins depend on status of combination of digital inputs and the clock status. Since the status of output is stable (either ‘0’ or ‘1’), flip flop can be used to store one bit of digital data. 

There are mostly below four types of flip flops which are widely used. 
    - SR Flip Flop (also known as Set-Reset flip flop) 
    - JK Flip Flop (also known as Jack Kilby flip flop based on name of its inventor) 
    - D Flip Flop (known as Data flip flop) 
    - T Flip Flop (known as Toggle flip flop)

All these flip flops can be realized using combinations of different types of digital gates we discussed in previous topic. We will discuss each type in detail.

What is there use?


These different types of flip-flops are being used in digital electronic circuits, some of the applications of Flip-flops are as specified below.
  • Counters
  • Frequency Dividers
  • Shift Registers
  • Storage Registers
  • Bounce elimination switch
  • Data storage
  • Data transfer
  • Latch
  • Registers
  • Storage Memory

 SR Flip Flop (Set-Reset flip flop)


S R Flip Flop

This is the logic diagram of SR flip flop using four gates, the symbol and the truth table. We can see in truth table that when the clock is LOW, there is no change in output for any combination of input at ‘S’ and ‘R’ inputs. ‘X’ in truth table denotes any value. It can be anything either LOW or HIGH. So the output is controlled by Clock (Clk) signal. Thus the output has two stable states when the clock is HIGH.

Since the output is stable at either HIGH(1) or LOW(0) hence this can store one bit of digital data.


D(Data) Type Flip Flop:


Data Flip Flop
D Type flip flop is also used as a digital memory storage element. This flip flop can be realized using four NAND gates and one NOT gate as shown here. Here again the output is effected only when the Clock (Clk) input is HIGH. While the clock is LOW, there is no change in output for any value at ‘D’ input hence in truth table in first line ‘X’ is used.  Here again the output has two stable states i.e. either LOW (0) or HIGH (1).


JK (Jack KIlby) Flip Flop:


J K Flip Flop
This flip flop was invented by Jack Kilby from Texas instruments, hence named as JK Flip Flop. Similar to SR and D type flip flop, the output state changes only when the clock signal is HIGH. While the clock is low there is no impact on output for any combination of inputs. They are used in shift registers, counters and storage etc. The output of JK flip flop toggles from HIGH to LOW and LOW to HIGH when both ‘J’ & ‘K’ inputs are high and obviously the clock signal is HIGH. Similar to others, this can also store one bit of digital data as it has two stable states.


T(Toggle) Flip Flop: 


T Flip Flop
It has nature of toggling the output between HIGH and LOW, hence the name given T (Toggle) flip flop. Looking at the logical diagram, we can see that it’s a modified version of JK flip flop. Here again there is no change in output while the clock signal is LOW. So, the output is again controlled by clock signal as we can see in truth table also. They are used in digital counters.

In next topic we will see a very multipurpose timer IC555 and its operation where we will see use of op-amps and flip flops as the building block of this IC. We will also see few of the implementations of IC555 in small hobby projects which are very easy to build.




Share:

Saturday, June 27, 2020

Logic gates……The building blocks of digital systems.

what are logic gates
The basic building blocks of any digital system are logic gates. These gates perform very basic function on the digital inputs like addition, multiplication and inverting bits. In general we have three basic logic gates i.e. “OR”, “AND” and “NOT” gate. There are many other logic gates which are combinations of these three basic logic gates. We will see here gates with two inputs but we can have gates with more than two inputs also based on requirement. Each logic gate can be made out of discrete components like Diode, Transistor and Resistor etc. The basic circuits of these logic gates, symbol of gates and respective truth table is shown in image.

The logical operation which each gate performs and accordingly the output which we get, is shown is a tabular form. This table shows different combinations of ‘1’ and ‘0’ at input and its corresponding output which we get after performing logical operation. Since it shows the logically true output for different inputs, hence this table is called “Truth Table”.

OR Gate:

This gate performs the addition of bits at the input side and present at output. A simple “OR” gate can be made using two Diodes and one Resistor as shown in diagram. ‘A’ and ‘B’ denotes two digital inputs and ‘C’ denotes the output. This circuit can be used for testing purpose but in practical cases, the ICs for OR gates are not made in such simple way. IC 7432 is a 14pin IC containing 04nos. “OR” gates inside it.
Let us see the different input conditions and corresponding outputs.

Condition-1: As per operating principal of diodes if we apply 0V (digital-0) at both inputs, both the diodes will be not operational and hence the out voltage will also be 0V i.e. digital-0 (LOW), that is what the truth table says for A=0 and B=0.

Condition-2 & 3: If we apply +5V (digital-1) at any of the inputs A or B, the respective diode will start conducting and the output will be +5V i.e. digital-1 at point ‘C’. This condition gives the name of this gate as OR gate because if either ‘A’ OR ‘B’ is digital-1, the output of this logic gate is digital-1 i.e. HIGH. This is again shown in truth table of OR gate.
OR gate using discrete components

Condition-4: If we apply +5V or HIGH input at both ‘A’ and ‘B’, again both diode will conduct and the output at ‘C’ will be HIGH i.e. +5V.
Note: Since always there will be a voltage drop across diode in practical scenario, hence the digital HIGH will not be exactly +5V but near to it as shown in this diagram.

AND Gate:

This gate performs multiplication operation on digital input bits presented at input ‘A’ and ‘B’. An AND gate can be realized using two diodes and one resistor. This time the load resistor is connected between output pin and +5V supply and the direction of diodes are reversed. IC 7408 is a 14pin IC containing 04nos. AND gate.
Below are different conditions and its corresponding logical output from AND gate.
AND gate using discrete components

Condition-1:
Since the diodes are in reverse condition and input is given in cathode, when both inputs are LOW or digital-0, both diodes will conduct because their anode is at HIGH side and cathode is at LOW potential. Under this condition the output voltage is actually the voltage drop across the diode i.e. around 0.7V. In practical scenario this voltage is considered as LOW i.e. digital-0. This condition is shown in the diagram.

Condition-2 & 3: In case either of the two inputs is LOW and other is HIGH, one diode is forward biased and the other is having same potential at its anode and cathode, hence one diode conduct and the other if off. Due to one forward based diode, the voltage at output is again around 0.7V hence is LOW.

Condition-4: When input ‘A’ AND ‘B’ both are high, in this condition both diodes are off and hence the 5V appears at the output through resistor and hence the output is HIGH i.e. digital-1. This condition gives the name as AND gate.

NOT Gate:

This performs simplest operation of inverting the state of any digital input. Input HIGH is converted to LOW and input LOW is converted to HIGH. This is sometimes referred as Inverter also, as it inverts the state of input. This is the reason the output is shown as reverse of input by showing a bar over it, as we learned in digital number system. Refer to the simple transistor based NOT gate circuit, when input is HIGH i.e. 5V, the transistor conducts and act as closed switch hence the output at its collector is LOW. And when the input is LOW the transistor act as open switch hence the output is +5V which comes through resistor and hence output is HIGH. IC 7404 is a 14pin IC which contains 06nos. of NOT gate inside it.

Gate Combinations:

what are NOR and NAND gates
There are many combinations of these basic logic gates to get other gates, but for simplicity we will discuss two basic extended gates i.e. “NOR” and “NAND” gate, other two are “XOR” and “XNOR” gates. As the name suggest and depicted in this image, NOR gate is a combination of “NOT” and “OR” gate. Similarly the NAND gate is combination of “NOT” and “AND” gate.

NOR Gate: To understand it simply connect the output of “OR” gate to a “NOT” gate to get a “NOR” gate. It means that the truth-table of NOR gate will be simply reverse of OR gate i.e. ZERO is replaced by ONE and ONE by ZERO due to NOT gate at the output side. The circle at the output of gate is representing NOT gate. IC 7402 contain 04nos. NOR gate, which is a 14pin IC.

NAND Gate: Similarly connect output of “AND” gate to “NOT” gate to get NAND gate. Hence the output in truth table will be simply reverse of AND gate i.e. ZERO is replaced by ONE and ONE by ZERO as NOT gate is present at output side. The circle at the output of gate is representing NOT gate. IC 7400 is a 14pin IC containing 04nos. NAND gate in it.

We have basically two different types of digital gate ICs, one which uses transistor inside called TTL i.e. “Transistor-Transistor Logic”. The other uses MOSFETs for its construction and is called CMOS logic gates. Under both categories we again have different range of ICs which can operate at different speed and different environmental conditions. Some are manufactured to operate at normal temperature levels and some at extreme temperatures which are used in industrial and military applications.

Operating voltage range for such TTL gates are 4.75V to 5V and for CMOS type is 3V to 15/18V.

input output levels of TTL logic gates
As we saw earlier that HIGH and LOW levels cannot be ideally 0V and 5V due to voltage drop in different components and also considering there can be noise voltage induced while output of one logic gate is fed to other logic gate for complicated functions in digital circuits, the LOW and HIGH is agreed as voltage range rather than a fix voltage.

As shown in diagram, for TTL logic gates for input side, 0V to 0.8V is considered as LOW(0) and 2.0V to 5V is considered as HIGH(1). That means if the input voltage is anywhere above 0.8V and below 2.0V, will be undetermined by logic gate and no operation will be performed. It will be neglected by gates.

Similarly, for output side 0V to 0.4V is to be considered as LOW (1) and 2.7V to 5V should be considered as HIGH (1) and anything above 0.4V and below 2.7V should be ignored.

For CMOS gates operating at 5V
Input: 0V - 1.5V is LOW and 3.5V - 5V is HIGH
Output: 0V - 0.05V is LOW and 4.95 - 5V is HIGH
For CMOS gates operating at 15V
Input: 0V - 4V is LOW and 11V - 15V is HIGH
Output: 0V - 0.05V is LOW and 14.95V - 15V is HIGH.

truth table of logic gates
So, in all cases we see that the input side is given larger window as digital signals coming from any other circuit or field may induce some electrical noise. Electrical noise is nothing but unwanted interference of electromagnetic waves induced in any wire which changes the current flowing through it hence inducing change in voltage at the other side of wire. Electrical noise is always expected in any circuit especially in industrial environment. Also, everywhere we are surrounded by lots of electromagnetic waves around us like, mobile signals, satellite TV signals, radiations coming out from Microwave oven, laptops operating at high frequency etc.

Here is the summary of truth table of all the five gates we have seen above. Using these we can have complicated logical operations by using any combination of these small logic gates.

That’s all about the basics of digital logic gates, keep visiting for more interesting topics and share comment if any topic is to be elaborated in more detail.


Share:

Sunday, June 14, 2020

What is binary number system?

what is binary number systemSome of you must be familiar with this number system, while others may be surprised to see this calculation. Yes in decimal number system, 1 + 1 = 2 but in digital number system 1 + 1 = 10. It’s not read as “Ten” rather it is read as “One Zero”. The decimal number system which we study in mathematics contains basic numbers 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9. All other numbers in decimal number system, are combination of any of these numbers only. But as we saw in previous topic where we compare analog and digital system, we said that digital system works on only two states i.e. ZERO and ONE. Hence the number system in digital also contains only ‘0’ and ‘1’ and all other numbers are only a combination of 0 and 1. This number system is called Binary Number System.


As the digital number system contains “Two” numbers only, hence it is called a Binary number system. “Bi” indicates number system with two basic values. These two binary digits i.e. ‘1’ and ‘0’ are also called “Bit”. The word “Bit” is the combination of Binary + Digit. So, in digital number system ‘1’ is one Bit and ‘0’ is another bit. All digital communications happens based on these bits, may it be communication over wire or wireless.

When you press any key on your computer keyboard, the digital data from keyboard goes to computer over the wire connected to it. When you are browsing any website over internet the digital data may be going over wired broadband or wireless Wi-Fi, but all these communications are in the form of ONLY ‘0’ and ‘1’.

A single bit is denoted as small character ‘b’. So, whenever we talk about speed of data transfer over wired or wireless media, it’s “Kbps” or “Mbps” i.e. Kilo bits per second and Megabits per second. 1Kilobit = 103bits and 1Megabit = 106 bits.

All the characters in the digital computers are a combination of 8bits, like for letter “a” it is “0110 0001” and for letter “A” it is “0100 0001”. Similarly we have 8bit combination for all other characters. This basic combination of 8bits is called a “Byte” i.e. 1byte = 8bits. Actually we don’t have space in between four digits, but for easy representation we show in this form.
Now let us see how all other numbers are denoted using bits. When a number is represented in a combination of 8bits, every number has its place value as we have in decimal number system. As this is a binary number the place value is decided by “2n” where ‘n’ is the place value staring from right and moving towards left. First place value at extreme right is ‘0’, then ‘1’, ‘2’ and so on till we reach extreme left.
binary number place value
Now the process to find out the decimal number from binary digits is simply to multiply each digit with its place value and then add all the numbers.
For example if we have a four digit number as “0001” its decimal value will be (8X0) + (4X0) + (2X0) + (1X1) = 0 + 0 + 0 + 1 = 1.
Let’s take another example of binary number – “0101”, its decimal equivalent will be (8X0) + (4X1) + (2X0) + (1X1) = 0 + 4 + 0 + 1 = 5.
Similarly let’s take another example of 8bit number like – 0110 1010, based on above method its decimal equivalent is (128X0) + (64X1) + (32X1) + (16X0) + (8X1) + (4X0) + (2X1) + (0X0) = 0 + 64 + 32 + 0 + 8 + 0 + 2 + 0 = 106.

unique possible numbers with bits
We have a standard formula that tells us how many unique combinations of bits we can make if we know the number of bits available with us. The formula is 2n, where ‘n’ is the number of bits. So, if we have two bits with us we can have 22 i.e. 4 different combinations. Similarly if we have three bits, we can have 23 i.e. 8 different combinations. Examples are shown in the image with two bits and three bits.
This is how a binary number represent all decimal numbers. 
In digital system one more notation is used to show complementary number i.e. complementary of ‘1’ is ‘0’ and complementary of ‘0’ is ‘1’. This is denoted in symbol by placing a horizontal line on top of number as shown in picture.
Decimal to binary conversion
So, any decimal number can be converted into binary number and for that we need to divide the number by ‘2’ and keep noting down the remainders. Every time the remainder will be either ‘0’ or ‘1’ only. Finally write the remainder numbers in sequence starting from bottom to top, to get its binary equivalent. As shown in this example, we have taken decimal number ‘25’ and we are finding the binary equivalent for it.
Step-1: 25 divided by 2, quotient is 12 and remainder is ‘1’.
Step-2: 12 divided by 2, quotient is 6 and remainder is ‘0’.
Step-3: 6 divided by 2, quotient is 3 and remainder is ‘0’.
Step-4: 3 divided by 2, quotient is 2 and remainder is ‘1’.
Step-5: Start writing the digits from last quotient and move toward top as shown by arrow, you will get “11001” and to show in a byte format you can add additional zeros in beginning to make it 8bit like “0001 1001”

addition of binary numbers
Addition of binary numbers is done as shown in this table. As we mentioned in the first line 1 + 1 = 10 i.e. 1 + 1 = 0 with carry ‘1’ which is placed before zero that’s the reason it is written as ‘1’ and ‘0’. It should not be read as “Ten”, as in digital number system we have only two bits i.e. ‘1’ and ‘0’.

That’s the basic of binary number system, next we will see about digital gates which are the building blocks of digital circuits.

Share:

Translate

Advertisement

Advertisement Space

Latest Post

How to make a wireless Oximeter?

During this Covid-19 pandemic oximeters are in high demand and so there are many different manufacturers making oximeter to supply in the ma...

 
wireless headphones