Saturday, 20 June 2015

Electronics and Number Systems.

In this article I am going to present two types of number systems.

Number systems can be largely classified as position weighted systems and non-position weighted systems. 

The numbers we use in daily life from 0-9 are called decimal number systems and they have a base or a radix of 10. As you may have studied earlier each position in this has a weight i.e 1,10,100,1000 and so on. Similarly Quinary,Hexadecimal, Octal and Binary are types of position weighted systems. 

Take for instance octal which is a base-8 number system in which numbers from 0 to 7 are used and instead of the 1,10,100.. 1,8,64,512 are used. so for example 17 in octal would be 21.

17  =  (2 * 8)+(1*1) 

Similarly hexadecimal has 16 numbers which contains numbers from 0-9 and the rest up to 15 are represented by letters from A up to E.

Another important position weighted system is the binary system, the binary code gained importance with logic gates and Boolean algebra. It basically uses two numbers 0 and 1. The positions are weighted according to 1,2,4,8,16. Take a number 1101 in binary in decimal it can be shown by 

(1*8)+(1*4)+(0*1)+(1*1) = 13

The arithmetic practices for Binary coding are a a little different than decimal not conceptually, but in implementation. For example a negative number in Decimal is just -256 or -537,but the negative sign lacks logical representation in Binary coding. What we do is find the complement of the number which means we express the number in a form which conveys that it is negative. So if we are performing subtraction in Binary we simple add the number we want to subtract from, to the complement of the number we wish to subtract.   
Now I don't wish go on lengths about this, but if you want deeper knowledge of Binary coding I suggest Digital Electronics by Mano Morris.

Non-position weighted systems include codes such as Gray code,Excess-3,Hamming code,Reed Muller code and many others. Here I will explain the Gray Code and the Excess 3. 

The Gray code is a binary code. But it differs from simple Binary in several aspects, the following list will help clarify.

Binary Code
Gray Code
0000
0000
0001
0001
0010
0011
0011
0010
0100
0110
0101
0111
0110
0101

The list contains Binary and Gray representation of numbers 0 to 6. The shrewd ones among you must have noticed that as the number progresses in Gray there is a difference of only one digit between each successive number. This is why Gray is so important in digital electronics. Logic circuits can have a large number of inputs but it is not possible to ensure that each input reach the circuit at the same time this results in error. But in Gray since only one digit changes at a time this problem does not arise. Gray code is also used in analog to digital conversion when each sample has to be converted to Binary it is actually Gray to which it is being converted. 

Gray code is also used for making angular measurements. A good understanding of Gray is essential as another very important application is in Karnaugh Maps or K-Maps, the K-Map is a logic minimization tool for reducing the number of logic gates required in a digital circuit. 

The Excess 3 is another another Binary code which is converted from Binary by simply adding the Binary code of 3 i.e 0011 to the Binary code you wish to convert. The main property of Excess 3 is that the complement of any Excess 3 number is the Excess 3 representation of the 9's complement of the same number. This is useful when it comes to Binary subtraction in computers. Again the complementary method is something you can read up on, or I'll explain if you ask me nicely.

Cheers, 

Abhijeet  

       

No comments:

Post a Comment