Codes in Digital Electronics

CODES

In digital system, the data or information such as numbers, letters, characters, or punctuation marks are depicted by a unique or particular set of symbols. They are fundamentally encrypted and, therefore, the group of symbols is considered as "CODE." In he digital system, encrypted means ‘encoded.’ This encoding or decoding is achieved using the encoder or decoder in the digital circuits.

  • Non-Binary

E.g., Morse code: - a series of dots and dashes are used to represent data.

  • Binary

E.g., Gray Code, BCD, Excess-3 Code, 8-4-2-1 code, Error detecting and correcting codes

  • Alphanumeric

E.g., Boudet’s (5-bit Code), ASCII Code (7 bit+ 1-bit parity), EBCDIC (8 bit)

Binary Coded Decimal Code (BCD)

In BCD, each digit of a decimal number is represented by a binary equivalent. It's a 4-bit code, which is additionally called 8-4-2-1 code. The best thing is that it is relatively simple converting to and from decimal. It falls within the weighted code system category. They're utilized in calculators, counters, digital voltmeters, digital clocks, etc.

Decimal to BCD conversion

Decimal to BCD conversion

Excess-3 Code

It is a 4-bit code. This can be derived easily from the BCD code by adding “3” to every digit of the coded number. It is a self-complementing code, which implies that the one’s complement of an excess-3 number is similar to the excess-3 code for the 9’s complement of the corresponding decimal number. It falls in the unweighted code system category.

Decimal to Excess-3 conversion

Decimal to Excess-3 conversion

Gray Code

It is a very useful code in which the code group changes only 1 bit when moving from one point to another point-also known as “Reflected Code” or “Minimum change code.” It is generally used in Input/output devices, instrumentations such as shaft encoders to calculate angular displacement, and in linear encoders to calculate linear displacement. It falls in the unweighted code system category.

Binary to Gray Code conversion

Starting from leftward and moving towards rightward, add each adjacent pair of binary digits to get gray code digit.

Binary to Gray Code conversion

Alphanumeric Codes

Sometimes data is represented in the mixed form of numbers, alphabets, and special characters. It is also known as “Internal code”, because representing data in the form of alphanumeric characters and symbols is an internal process. Most commonly used such codes are:-

  1. Extended BCD Interchange Code (EBCDIC):- It is 8-bit code. It can represent 28=256 possible Characters.
  • American Standard Code for Information Interchange:- It is most widely used in many mainframes having a 7-bit code. It can represent 27=128 possible Characters. They are also pronounced as ASCII (ask-ee).
Alphanumeric Codes

Error Detecting Code

When data flows from Transmitter points to Receiver point, errors are occurred due to the electrical noise in the system. The simplest and widely used scheme for detecting this type of error is the “Parity method.” An extra bit or called a “Parity bit,” is combined with the original transmitted code to make the total count of “1’s” to be even or odd.

Error Detecting Code

Note: - This method has some limitations. It will not work if two bits are in error.

Error Correcting Code

This type of code does both tasks, such as finding the error as well as correcting it. The “HAMMING CODE” is the most widely used. This code is generated for a group of n-bit data by adding ‘k’ parity or check bits to make a form of (n+k)-bit code.  The magnitude of ‘k’ is selected in such a way that it can describe (n+k) possible error bit locations and also helps to determine the “no error” condition. Inequality for choosing the value of ‘k’ is:-

                                             2k ? n+k+1

Error Correcting Code

Related Topics

Oscilloscope

With the use of an oscilloscope, you may observe the waveform of electronic signals and the changes in voltage over time. Why is that crucial? Circuits are required to transmit electrical energy...

3 minutes read.

Encoder in Digital Electronics

Encoders in Digital Logic Encoder is a digital circuit in which the performed operation is exactly the opposite of decoders. An encoder consists of a maximum of 2n inputs and produces...

3 minutes read.

Base Conversion in Number System

Base Conversion in Number System: In previous topic, we have learnt about different number systems. In this topic, we will learn how to convert one number system into another, such...

4 minutes read.

Data Representation in Digital Electronics

Data Representation in Digital Electronics In digital electronics, we can represent the data in following ways: In the conventional arithmetic system, a negative number is represented by a minus sign and a...

4 minutes read.

Digital Electronics Tutorial

Introduction to Digital Electronics If you would like to learn all about digital electronics from 0 (basic) to 1 (expert level), then you are in the right place. In this tutorial...

4 minutes read.

Combinational Logic Circuit

Combinational Logic Circuit In digital system, Logic circuits generally fall into two categories. Combinational circuit: - At any instant of time, the output of the logic circuit depends on the inputs of...

3 minutes read.

Analog Circuits v/s Digital Circuits

Analog Circuit An analogue circuit uses analogue signals, which include more data since they are continuous waves as opposed to the binary downs and ups of a digital waveform. The whole...

5 minutes read.

Boolean algebra

Boolean algebra In real world, devices such as calculators are considered as magical devices that perform complex calculations in a fraction of seconds. It is because the electronic devices in digital...

4 minutes read.

Capacitors in DC Circuit

Capacitor & Capacitance A capacitor is defined as any pair of conducting surfaces divided by an insulating substance. The capacitor's conducting surfaces are referred to as the plates, and the insulating...

6 minutes read.

Digital Electronics: Digital Number System

Digital Number System In the real world, when any person says that “he has 8 rupees.”, we understand the statement easily, but digital systems don’t understand it. Digital systems understand the...

2 minutes read.

Codes in Digital Electronics

CODES In digital system, the data or information such as numbers, letters, characters, or punctuation marks are depicted by a unique or particular set of symbols. They are fundamentally encrypted and,...

3 minutes read.

Working of BJT (Bipolar Junction Transistor)

Bipolar Junction Transistor (BJT) A bipolar junction transistor (BJT) is a three-terminal device that consists of two pn-junctions constructed by placing one p-type or n-type semiconductor between 2 sets of semiconductors...

3 minutes read.

Half Adder, Full Adders in Digital Electronics

Adders Before understanding the adders, lets first understand the arithmetic circuits that are used in Digital System. Arithmetic circuits In digital systems, various data processing tasks can be performed. Arithmetic circuits are derived...

13 minutes read.