Number Systems in Digital Electronics
The digital computer is a digital system
that performs various computational tasks. The word digital implies that the
information in the computer is represented by variables that take a limited
number of discrete values. The count of these limited number is denoted by Base
or Radix.
Base – A
number system of base or radix “r” is a system that uses r distinct symbols to
represent any number
The table below summarizes four number
systems, their base and the distinct symbols used by these number systems to
represent any number:
Number System
|
Base / Radix
|
Distinct Symbols
|
Binary
|
2
|
0, 1
|
Octal
|
8
|
0 – 7
|
Decimal
|
10
|
0 – 9
|
Hexadecimal
|
16
|
0 – 9, A, B, C, D, E, F
|
Note: In hexadecimal format, A=>10,
B=>11, C=>12, D=>13, E=>14, F=>15
Now let’s take an example of an absolute number and a fractional number and see how to convert from one base to another.
Convert from Binary to Decimal
1010 = 1*23 + 0*22 + 1*21 + 0*20 = 8 + 0 + 2
+ 0 = 10
1010.01 = 1*23 + 0*22 + 1*21 + 0*20 + 0*2-1 + 1*2-2 = 8 + 0 + 2
+ 0 + 0 + 0.25 = 10.25
Here 2-1 means ½ and
2-2 means 1/22
(1010)2 = (10)10
(1010.01)2 = (10.25)10
Convert from Binary to Octal
Since octal is represented using 3 digits
(as 8 = 23), assemble
the digits in a group of 3 starting from right to left to convert from binary
to octal. For fractional part, grouping needs to be done from left to right.
Extra zeros should be added to form a group of 3 as shown below:
1010 = 1 010 = 001 010 = 12
1010.01 = 1 010.010 = 001 010.010 = 12.2
(1010)2 = (12)8
(1010.01)2 = (12.2)8
Convert from Binary to Hexadecimal
Since hexadecimal numbers are represented
using 4 digits (as 16 = 24), assemble
the digits in a group of 4 starting from right to left to convert from binary
to hexadecimal. For fractional part, grouping needs to be done from left to
right. Extra zeros should be added to form a group of 4 as shown below:
1010 = 1010 = A
1010.01 = 1010.0100 = A.4
(1010)2 = (A)16
(1010.01)2 = (A.4)16
Convert from Octal to Binary
12 = 001 010 = 1010
12.2 = 001 010.0100 = 1010.01
(12)8 = (1010)2
(12.2)8 = (1010.01)2
Convert from Octal to Decimal
12 = 1*81 + 2*80 = 8 + 2 * 1
= 10
12.2 = 1*81 + 2*80 + 2*8-1 = 8 + 2 * 1
+ 2/8 = 8 + 2 + 0.25 = 10.25
(12)8 = (10)10
(12.2)8 = (10.25)10
Convert from Octal to Hexadecimal
Since hexadecimal numbers are represented
using 4 digits (as 16 = 24), assemble
the digits in a group of 4 starting from right to left to convert from octal to
hexadecimal. For fractional part, grouping needs to be done from left to right.
Extra zeros should be added to form a group of 4 as shown below:
12 = 001 010 = 00 1010 = 0000 1010 = 0A = A
12.2 = 001 010.010 = 00 1010.0100 = 0000 1010.0100 = 0A.4 = A.4
(12)8 = (A)16
(12.2)8 = (A.4)16
Convert from Decimal to Binary
To convert from decimal to binary, given
number should be divided by 2, until the quotient can not be divided further.
(10)10 = (1010)2
0.25 * 2 = 0. 50 | 0 (Most Significant
Digit)
0.50 * 2 = 1. 00 | 1 (MSD)
(0.25)10 = (01)2
(10.25)10 = (1010.01)2
Convert from Decimal to Octal
To convert from decimal to octal, given
number should be divided by 8, until the quotient can not be divided further.
(10)10 = (12)8
0.25 * 8 = 2. 00 | 2 (Most Significant
Digit)
(10.25)10 = (12.2)8
Convert from Decimal to Hexadecimal
To convert from decimal to hexadecimal,
given number should be divided by 16, until the quotient can not be divided
further.
(10)10 = (A)16
0.25 * 16 = 4. 00 | 4 (Most Significant
Digit)
(10.25)10 = (A.4)16
Convert from Hexadecimal to Binary
A = 1010
(A)16 = (1010)2
A.4 = 1010.0100 = 1010.01
(A.4)16 = (1010.01)2
Convert from Hexadecimal to Octal
Since octal is represented using 3 digits
(as 8 = 23), assemble
the digits in a group of 3 starting from right to left to convert from
hexadecimal to octal. For fractional part, grouping needs to be done from left
to right. Extra zeros should be added to form a group of 3 as shown below:
A = 1010 = 1 010 = 001 010 = 12
A.4 = 1010.100 = 1 010.100 = 001 010.100 = 12.4
(A)16 = (12)8
(A.4)16 = (12.4)8
Convert from Hexadecimal to Decimal
A = 10*160 = 10 * 1 =
10
A.4 = 10*160 + 4 * 16-1 = 10 * 1 +
4/16 = 10 + 0.25 = 10.25
(A)16 = (10)10
(A.4)16 = (10.25)10
FAQs about Number System
Q. Why we section off 3 bits in Octal and 4
bits in Hexadecimal?
A.As per definition
of base given above – A number system of base or radix “r” is a system that
uses r distinct symbols to represent any number. Thus, octal with a base of 8,
uses 8 distinct symbols (which can be represented by 3 digits as 8=2^3) and
hexadecimal with a base of 16, uses 16 distinct symbols (which can be
represented by 4 digits as 16=2^4). So as octal is represented using 3 digits,
we section off 3 binary numbers starting from right, and as hexadecimal number
is represented using 4 digits, we section off 4 binary numbers starting from
right.
Q. How to convert any non-decimal number to
a number with base x?
A. To convert a number to some other base say
x, the procedure is to first convert the number to decimal and then divide it
by x repeatedly till the quotient is greater than or equal to x.
Above are the examples of conversions from
one base to another and can be utilized to covert any number from any base to
any base. Please feel free to leave your footprints in the comments section below
for any clarifications to above and anything related to Number System in
Digital Electronics
In our daily life we use "decimal
number system". Now don't give me that look, decimal number system is just
a numbering system which we use to count things, measure quantities, maintain
our bills, bank maintains their accounts etc..etc. Yes, we use only 10 symbols
to do any kind of counting, these 10 symbols are '0', '1', '2', '3', '4', '5',
'6', '7', '8' and '9'. Since there are only 10 symbols this numbering system it
is called deci-mal(deci means 10).
There are also other numbering systems
namely..
Octa Decimal : Here we use only eight
symbols (octa means 8), these are '0', '1', '2', '3', '4', '5', '6' and '7'
Hexa Decimal : This numbering system
uses total 16 symbols: 0 to 9, 'A', 'B' , 'C', 'D', 'E' and 'F'
Binary : Here we use only two
symbols '0' and '1'
Buy why on the earth will any body will
require these weired numbering system ? Yes, you are correct..all these weird
numbering systems are computer/digital system friendly. These number systems
are widely used in digital systems like microprocessor, logic circuits,
computers etc. All System designers prefer to use these numbering systems, as
these are more continent from digital systems point of view. For example any
digital system understands only two things "no voltage" and
"voltage" i.e '0' and '1' at input/output. Hence always use
Hexa-decimal and binary numbering system while designing. It is good idea not
to combine decimal and hexa-decimal while putting specifications.
To understand how other numbering systems
can be used, lets re-analyze how we use decimal numbering system..
In decimal system we first use all the
symbols while counting and when we run out of symbols we re-use these symbols
on the ten's position in the same sequence. But symbols at ten's position
changes only when we run out of symbols at one's position. For example, lets
say we are counting bottles. First we will use 0 to 9 to count 9 bottles now
the next counted bottle will be counted as 10, observe this carefully, since we
ran out of symbol we started using ten's position, again symbol at ten's
position will change when we run out of symbol at one's position i.e When our
counting moves from 19 to 20. This rule applies to ones, tens, hundred,
thousand ... to all decimal places.
The same rule is applied when we count
using any other numbering system. Lets say you have 12 bottles (decimal), but
you want to count it using octa-decimal numbering system.
Bottle
count in :
Decimal Octa-Decimal
Hexa-Decimal Binary
0 0 0 0
1 1 1 1
2 2 2 10
3 3 3 11
4 4 4 100
5 5 5 101
6 6 6 110
7 7 7 111
8 10 8 1000
9 11 9 1001
10 12 A 1010
11 13 B 1011
Observe that, while
counting in octa-decimal when we run out of symbol after 7, we started using
ten's position. In our daily life we start from 1 instead of 0, but for
simplicity in above example we started counting from 0 even in decimal.
Remember that in hexa decimal and binary we always count from 0. we will see
other arithmetic operation on binary in next topic.
Number Systems
There are infinite ways to represent a number. The four commonly
associated with modern computers and digital electronics are: decimal, binary,
octal, and hexadecimal.
Decimal (base 10) is the way most human beings represent numbers.
Decimal is sometimes abbreviated as dec.
Decimal counting goes:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, and so on.
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, and so on.
Binary (base 2) is the natural way most digital circuits represent and
manipulate numbers. (Common misspellings are “bianary”, “bienary”, or
“binery”.) Binary numbers are sometimes represented by preceding the value with
'0b', as in 0b1011. Binary is sometimes abbreviated as bin.
Binary counting goes:
0, 1, 10, 11, 100, 101, 110, 111, 1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111, 10000, 10001, and so on.
0, 1, 10, 11, 100, 101, 110, 111, 1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111, 10000, 10001, and so on.
Octal (base 8) was previously a popular choice for representing
digital circuit numbers in a form that is more compact than binary. Octal is
sometimes abbreviated as oct.
Octal counting goes:
0, 1, 2, 3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 15, 16, 17, 20, 21, and so on.
0, 1, 2, 3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 15, 16, 17, 20, 21, and so on.
Hexadecimal (base 16) is currently the most popular choice for representing
digital circuit numbers in a form that is more compact than binary. (Common
misspellings are “hexdecimal”, “hexidecimal”, “hexedecimal”, or “hexodecimal”.)
Hexadecimal numbers are sometimes represented by preceding the value with '0x',
as in 0x1B84. Hexadecimal is sometimes abbreviated as hex.
Hexadecimal counting goes:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F, 10, 11, and so on.
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F, 10, 11, and so on.
All four number systems are equally capable of representing any
number. Furthermore, a number can be perfectly converted between the various
number systems without any loss of numeric value.
At first blush, it seems like using any number system other than
human-centric decimal is complicated and unnecessary. However, since the job of
electrical and software engineers is to work with digital circuits, engineers
require number systems that can best transfer information between the human
world and the digital circuit world.
It turns out that the way in which a number is represented can
make it easier for the engineer to perceive the meaning of the number as it
applies to a digital circuit. In other words, the appropriate number system can
actually make things less complicated.
Fundamental Information Element of Digital Circuits
Almost all modern digital circuits are based on two-state
switches. The switches are either on or off. It doesn’t matter if the switches
are actually physical switches, vacuum tubes, relays, or transistors. And, it
doesn’t matter if the 'on' state is represented by 1.8 V on a cutting-edge CPU
core, -12 V on a RS-232 interface chip, or 5 V on a classic TTL logic chip.
Because the fundamental information element of digital circuits
has two states, it is most naturally represented by a number system where each
individual digit has two states: binary.
For example, switches that are 'on' are represented by '1' and switches
that are 'off' are represented by '0'. It is easy to instantly comprehend the
values of 8 switches represented in binary as 10001101. It is also easy to
build a circuit to display each switch state in binary, by having an LED (lit
or unlit) for each binary digit.
Making Values More Compact
“Binary digit” is a little unwieldy to say over and over, so the
term was contracted to “bit”. Not only is the term “binary digit” a little
unwieldy, but so is the length of a binary number, since each digit can only
represent one switch. As digital circuits grew more complex, a more compact
form of representing circuit information became necessary.
An octal number (base 8) can be up to 1/3 the length of a binary
number (base 2). 8 is a whole power of 2 (23=8). That means three
binary digits convert neatly into one octal digit.
A hexadecimal number (base 16) can be up to 1/4 the length of a
binary number. 16 is a whole power of 2 (24=16). That means four
binary digits convert neatly into one hexadecimal digit.
Unfortunately, decimal (base 10) is not a whole power of 2. So,
it is not possible to simply chunk groups of binary digits to convert the raw
state of a digital circuit into the human-centric format.
Let’s see how to convert a
number from binary...
Binary to Octal
An easy way to convert from binary to octal is to group binary
digits into sets of three, starting with the least significant (rightmost)
digits.
Binary: 11100101 =
|
11 100 101
|
|
011 100 101
|
Pad the most significant digits with zeros if necessary to complete
a group of three.
|
Then, look up each group in
a table:
Binary:
|
000
|
001
|
010
|
011
|
100
|
101
|
110
|
111
|
Octal:
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
Binary =
|
011
|
100
|
101
|
|
Octal =
|
3
|
4
|
5
|
= 345 oct
|
Binary to Hexadecimal
An equally easy way to convert from binary to hexadecimal is to
group binary digits into sets of four, starting with the least significant
(rightmost) digits.
Binary: 11100101 = 1110 0101
Then, look up each group in
a table:
Binary:
|
0000
|
0001
|
0010
|
0011
|
0100
|
0101
|
0110
|
0111
|
Hexadecimal:
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
Binary:
|
1000
|
1001
|
1010
|
1011
|
1100
|
1101
|
1110
|
1111
|
Hexadecimal:
|
8
|
9
|
A
|
B
|
C
|
D
|
E
|
F
|
Binary =
|
1110
|
0101
|
|
Hexadecimal =
|
E
|
5
|
= E5 hex
|
Binary to Decimal
They say there are only 10 people in this world: those that
understand binary and those that don’t. Ha ha.
If you don’t get that joke, you'll need a method to convert from
binary to decimal. One method involves addition and multiplication.
- Start the
decimal result at 0.
- Remove the
most significant binary digit (leftmost) and add it to the result.
- If all
binary digits have been removed, you’re done. Stop.
- Otherwise,
multiply the result by 2.
- Go to step
2.
Here is an example of converting 11100000000 binary to decimal:
Binary Digits
|
Operation
|
Decimal
Result
|
Operation
|
Decimal
Result
|
11100000000
|
+1
|
1
|
× 2
|
2
|
1100000000
|
+1
|
3
|
× 2
|
6
|
100000000
|
+1
|
7
|
× 2
|
14
|
00000000
|
+0
|
14
|
× 2
|
28
|
0000000
|
+0
|
28
|
× 2
|
56
|
000000
|
+0
|
56
|
× 2
|
112
|
00000
|
+0
|
112
|
× 2
|
224
|
0000
|
+0
|
224
|
× 2
|
448
|
000
|
+0
|
448
|
× 2
|
896
|
00
|
+0
|
896
|
× 2
|
1792
|
0
|
+0
|
1792
|
done.
|
A repeated division and remainder algorithm can convert decimal
to binary, octal, or hexadecimal.
- Divide the
decimal number by the desired target radix (2, 8, or 16).
- Append the
remainder as the next most significant digit.
- Repeat until
the decimal number has reached zero.
Decimal to Binary
Here is an example of using repeated division to convert 1792
decimal to binary:
Decimal Number
|
Operation
|
Quotient
|
Remainder
|
Binary
Result
|
|
1792
|
÷ 2 =
|
896
|
0
|
0
|
|
896
|
÷ 2 =
|
448
|
0
|
00
|
|
448
|
÷ 2 =
|
224
|
0
|
000
|
|
224
|
÷ 2 =
|
112
|
0
|
0000
|
|
112
|
÷ 2 =
|
56
|
0
|
00000
|
|
56
|
÷ 2 =
|
28
|
0
|
000000
|
|
28
|
÷ 2 =
|
14
|
0
|
0000000
|
|
14
|
÷ 2 =
|
7
|
0
|
00000000
|
|
7
|
÷ 2 =
|
3
|
1
|
100000000
|
|
3
|
÷ 2 =
|
1
|
1
|
1100000000
|
|
1
|
÷ 2 =
|
0
|
1
|
11100000000
|
|
0
|
done.
|
Decimal to Octal
Here is an example of using repeated division to convert 1792
decimal to octal:
Decimal Number
|
Operation
|
Quotient
|
Remainder
|
Octal
Result
|
|
1792
|
÷ 8 =
|
224
|
0
|
0
|
|
224
|
÷ 8 =
|
28
|
0
|
00
|
|
28
|
÷ 8 =
|
3
|
4
|
400
|
|
3
|
÷ 8 =
|
0
|
3
|
3400
|
|
0
|
done.
|
Decimal to Hexadecimal
Here is an example of using repeated division to convert 1792
decimal to hexadecimal:
Decimal Number
|
Operation
|
Quotient
|
Remainder
|
Hexadecimal
Result
|
|
1792
|
÷ 16 =
|
112
|
0
|
0
|
|
112
|
÷ 16 =
|
7
|
0
|
00
|
|
7
|
÷ 16 =
|
0
|
7
|
700
|
|
0
|
done.
|
The only addition to the algorithm when converting from decimal
to hexadecimal is that a table must be used to obtain the hexadecimal digit if
the remainder is greater than decimal 9.
Decimal:
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
Hexadecimal:
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
Decimal:
|
8
|
9
|
10
|
11
|
12
|
13
|
14
|
15
|
Hexadecimal:
|
8
|
9
|
A
|
B
|
C
|
D
|
E
|
F
|
The addition of letters
can make for funny hexadecimal values. For example, 48879 decimal converted to
hex is:
Decimal
Number
|
Operation
|
Quotient
|
Remainder
|
Hexadecimal
Result
|
|
48879
|
÷ 16
=
|
3054
|
15
|
F
|
|
3054
|
÷ 16
=
|
190
|
14
|
EF
|
|
190
|
÷ 16
=
|
11
|
14
|
EEF
|
|
11
|
÷ 16
=
|
0
|
11
|
BEEF
|
|
0
|
done.
|
Other fun hexadecimal
numbers include: AD, BE, FAD, FADE, ADD, BED, BEE, BEAD, DEAF, FEE, ODD, BOD,
DEAD, DEED, BABE, CAFE, C0FFEE, FED, FEED, FACE, BAD, F00D, and my initials
DAC.
Octal to Binary
Converting from octal to binary is as easy as converting from
binary to octal. Simply look up each octal digit to obtain the equivalent group
of three binary digits.
Octal:
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
Binary:
|
000
|
001
|
010
|
011
|
100
|
101
|
110
|
111
|
Octal =
|
3
|
4
|
5
|
|
Binary =
|
011
|
100
|
101
|
= 011100101 binary
|
Octal to Hexadecimal
When converting from octal to hexadecimal, it is often easier to
first convert the octal number into binary and then from binary into
hexadecimal. For example, to convert 345 octal into hex:
(from the previous example)
Octal =
|
3
|
4
|
5
|
|
Binary =
|
011
|
100
|
101
|
= 011100101 binary
|
Drop any leading zeros or pad with leading zeros to get groups of four binary digits (bits):
Binary 011100101 = 1110 0101
Then, look up the groups in a table to convert to hexadecimal
digits.
Binary:
|
0000
|
0001
|
0010
|
0011
|
0100
|
0101
|
0110
|
0111
|
Hexadecimal:
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
Binary:
|
1000
|
1001
|
1010
|
1011
|
1100
|
1101
|
1110
|
1111
|
Hexadecimal:
|
8
|
9
|
A
|
B
|
C
|
D
|
E
|
F
|
Binary =
|
1110
|
0101
|
|
Hexadecimal =
|
E
|
5
|
= E5 hex
|
Therefore, through a two-step conversion process, octal 345
equals binary 011100101 equals hexadecimal E5.
Octal to Decimal
Converting octal to decimal can be
done with repeated division.
1. Start the
decimal result at 0.
2. Remove the
most significant octal digit (leftmost) and add it to the result.
3. If all
octal digits have been removed, you’re done. Stop.
4. Otherwise,
multiply the result by 8.
5. Go to step
2.
Octal
Digits
|
Operation
|
Decimal
Result
|
Operation
|
Decimal
Result
|
345
|
+3
|
3
|
× 8
|
24
|
45
|
+4
|
28
|
× 8
|
224
|
5
|
+5
|
229
|
done.
|
The conversion can also be
performed in the conventional mathematical way, by showing each digit place as
an increasing power of 8.
345 octal = (3 * 82) +
(4 * 81) + (5 * 80) = (3 * 64) + (4 * 8) + (5 * 1) = 229
decimal
Hexadecimal to Binary
Converting from hexadecimal to
binary is as easy as converting from binary to hexadecimal. Simply look up each
hexadecimal digit to obtain the equivalent group of four binary digits.
Hexadecimal:
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
Binary:
|
0000
|
0001
|
0010
|
0011
|
0100
|
0101
|
0110
|
0111
|
Hexadecimal:
|
8
|
9
|
A
|
B
|
C
|
D
|
E
|
F
|
Binary:
|
1000
|
1001
|
1010
|
1011
|
1100
|
1101
|
1110
|
1111
|
Hexadecimal =
|
A
|
2
|
D
|
E
|
|
Binary =
|
1010
|
0010
|
1101
|
1110
|
=
1010001011011110 binary
|
Hexadecimal to Octal
When converting from hexadecimal
to octal, it is often easier to first convert the hexadecimal number into
binary and then from binary into octal. For example, to convert A2DE hex into
octal:
(from the
previous example)
Hexadecimal =
|
A
|
2
|
D
|
E
|
|
Binary =
|
1010
|
0010
|
1101
|
1110
|
=
1010001011011110 binary
|
Add leading zeros or remove
leading zeros to group into sets of three binary digits.
Binary: 1010001011011110 = 001 010 001 011 011 110
Then, look
up each group in a table:
Binary:
|
000
|
001
|
010
|
011
|
100
|
101
|
110
|
111
|
Octal:
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
Binary =
|
001
|
010
|
001
|
011
|
011
|
110
|
|
Octal =
|
1
|
2
|
1
|
3
|
3
|
6
|
=
121336 octal
|
Therefore, through a two-step
conversion process, hexadecimal A2DE equals binary 1010001011011110 equals
octal 121336.
Hexadecimal to Decimal
Converting hexadecimal to decimal
can be performed in the conventional mathematical way, by showing each digit
place as an increasing power of 16. Of course, hexadecimal letter values need
to be converted to decimal values before performing the math.
Hexadecimal:
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
Decimal:
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
Hexadecimal:
|
8
|
9
|
A
|
B
|
C
|
D
|
E
|
F
|
Decimal:
|
8
|
9
|
10
|
11
|
12
|
13
|
14
|
15
|
A2DE hexadecimal:
= ((A) * 163) + (2 * 162) + ((D) * 161) + ((E) * 160)
= (10 * 163) + (2 * 162) + (13 * 161) + (14 * 160)
= (10 * 4096) + (2 * 256) + (13 * 16) + (14 * 1)
= 40960 + 512 + 208 + 14
= 41694 decimal
MEMORY:
SAM (Sequentially Access
Memory) is accessed by stepping through each memory location until the desired
location is reached. Magnetic tape is an example of SAM.
The second category of memory
devices is called RAM (Random Access Memory) where the memory can be randomly
accessed at any instant, without having to step through each memory location.
It is generally faster to access a RAM compared to SAM. Most of the electronics
gadgets memory are of RAM type.
Random Access Memory (RAM) Memory Device
Random Access Memory (RAM) Memory Device
RAM memory is
"volatile" which means that the information stored in the RAM will be
lost once the power to it is removed. Two common types of RAM are DRAM (Dynamic
RAM) and SRAM (Static RAM). DRAM stored a bit as the presence or absence of
charge on MOSFET gate substrate capacitance.
As the capacitance has leakage,
it must be refreshed every few miliseconds. SRAM is an array of flip flops of
which the bit stored in the flip flop will remain until power is removed or
another bit replaces it. SRAM does not need to be refreshed. DRAM is usually
1.5 to 4 times as dense as SRAM and hence cheaper. However, SRAM has faster
access times than DRAM.
Read Only Memory (ROM) Memory Device
ROM is non volatile in that its
contents are not lost when power to it is removed. All ROMs can be programmed
at least once. Mask ROMs are programmed by having "1"s and
"0"s etched into their semiconductors at the time of manufacturing.
Programmable ROM (PROM) can be
written after manufacturing by electrically burning specific transistors or
diodes in the memory array. EPROM can be erased and reprogrammed by using
ultraviolet light.
EEPROM
(electronically erasable PROM) data can be erased electronically but
it takes longer time compared to RAM. Read and write time for RAM is almost the
same but PROM has slower write times. PROM must be erased before they can be
reprogrammed and it often needs a higher programming voltage than its operating
voltage.
ROM is usually used to store
data or programs that do not change frequently and must still be there when
power supply cuts off.
Non Volatile RAM (NVRAM) Memory Device
A NVRAM chip consists of both
RAM and ROM. During power on reset, the contents of the ROM are copied to RAM.
Before the power turns off, the system will copy the entire contents of the RAM
into ROM for non volatile storage. The RAM in an NVRAM is called shadow RAM.
NVRAM fills the gap between easily written memory and non volatile memory.
Modem
Introduction:
A
modem is a device or program that enables a computer to transmit data over, for
example, telephone or cable lines. Computer information is stored digitally,
whereas information transmitted over telephone lines is transmitted in the form
of analog waves. A modem converts between these two forms.
Fortunately, there is one standard interface for connecting external modems to
computers called RS-232. Consequently, any external modem can be attached to
any computer that has an RS-232 port, which almost all personal computers have.
There are also modems that come as an expansion board that you can insert into
a vacant expansion slot. These are sometimes called onboard or internal modems.
Modem Operation
Modes of Modem
operation
a). Simplex mode
In this mode,
the data sets are transmitted in only one direction. This type of data set uses
only one transmission channel. So that no signaling is available from the
receiver to the transmitter. It is an economical method of data transfer.
It is not suited for error correction and requests for retransmission methods.
b).
Half duplex
Some modems
provide for data transfer in both directions, but the data will flow in one
direction at a time. It requires only one transmission channel, but the channel
must be bidirectional. The speed of transmission is low.
c).
Full duplex
Full duplex
operation permits transmission in both directions at the same time. It requires
two 2 wire circuits one 4-wire circuit. Modems are placed at each end of the
circuits to provide modulation and demodulation.
Serial Interface Standard – RS 232
RS 232:
Short for
recommended standard-232C, a standard interface approved by the Electronic
Industries Alliance (EIA) for connecting serial devices. In 1987, the EIA released
a new version of the standard and changed the name to EIA-232-D. And in 1991,
the EIA teamed up with Telecommunications Industry association (TIA) and issued
a new version of the standard called EIA/TIA-232-E. Many people, however, still
refer to the standard as RS-232C, or just RS-232.
Almost all
modems conform to the EIA-232 standard and most personal computers have an
EIA-232 port for connecting a modem or other device. In addition to modems,
many display screens, mice, and serial printers are designed to connect to a
EIA-232 port. In EIA-232 parlance, the device that connects to the interface is
called a Data Communications Equipment (DCE) and the device to which it
connects (e.g., the computer) is called a Data Terminal Equipment (DTE).
The EIA-232
standard supports two types of connectors -- a 25-pin D-type connector (DB-25)
and a 9-pin D-type connector (DB-9). The type of serial communications used by
PCs requires only 9 pins so either type of connector will work equally well.
Although EIA-232
is still the most common standard for serial communication, the EIA has
recently defined successors to EIA-232 called RS-422 and RS-423. The new
standards are backward compatible so that RS-232 devices can connect to an
RS-422 port.
The standard 25-pin RS-232 connector
Features:
1. It is
used for serial communication
2. It is
a protocol standard as well as electrical standard.
3. It is
is used for short distances, upto 50ft.
4. It is
maximum data reate is 20,000 bd.
5. It is
not TTL compatible.
Errror Detection and correction
Introduction
Transmission of a signal is always
subject to an error which may be caused due to various kinds of noises. These
are all grouped into the so called transmission line spikes.
Normally noise interference with data by
noise created in the channel itself or from the transmitting equipments. In the
receiver this noise may give wrong data. As shown in fig 10, due to positive
noise voltage, a 0 bit may be represented as 1 bit. Similarly, due to negative
noise voltage a 1bit may be represented as 0 bit. Thus due to noise
interference, there is a possibility to receive wrong data at the receiver end.
Error control coding involves systematic
addition of extra digits to the transmitted message. These extra check digits
convey no information but they are used to detect or correct errors in the
regenerated message digits.
ERROR DETECTION CODES
Coding
for error detection without correction is simpler than error correction coding.
When a two way channel exists between source and destination, the receiver can
request transmission of information containing detected errors.
The
codes developed for providing automatic error detection are 1. Redundant Codes
2. Parity Check Codes
Cyclic Redundancy check Codes (CRC)
These
codes are also one type of parity check codes. These code uses shift registers
with feedback to create parity bits based on polynomial representation of the
data bits. Basically it involves treating both transmitted and received data
with the same polynomial.
The
remainder after the receive processing will be zero if no errors have occurred.
Cyclic codes provide the highest level of error detection to the same
redundancy of any parity check code.
Parity Check Codes
The
simplest form of error detection is parity; Single parity is established as
follows. First, the information is coded in the normal manner using one of the
standard binary codes. Each character is then examined to determine whether it
contains an even or an odd number of 1 bits for example
Pulse
|
Number
of one's
|
Parity
|
10101
|
3
|
Odd
|
11011
|
4
|
Even
|
If
even parity is to be established, a 1 bit is added to each odd character, and a
0 bit is added to each even character. The result is that all the characters
now contain an even number of 1 bits.
After
transmission each character is examined to see if it still contains an even
number of 1 bits. If it does not, the presence of an error is indicated. If it
does, the parity bit is removed and the data passed to the user.
This
form of parity will detect errors only if an odd number of bits are disturbed.
An even number of errors within the same character will compensate for each
other and go undetected.
Error Correction:
After having detected the error, it needs correction or
minimization of errors. Usually three methods have been adopted for error
correcting purposes.
Digital Modulation Techniques
The
techniques used to modulate digital information so that it can be transmitted
via microwave, satellite or down a cable pair are different to that ofanalogue
transmission. The data transmitted via satellite or microwave is transmitted as
an analogue signal. The techniques used to transmit analogue signals are used
to transmit digital signals. The problem is to convert the digital signals to a
form that can be treated as an analogue signal that is then in the appropriate
form to either be transmitted down a twisted cable pair or applied to the RF
stage where is modulated to a frequency that can be transmitted via microwave
or satellite.
The equipment that is used to convert
digital signals into analogue format is a modem. The word modem is made up of
the words “modulator” and “demodulator”. A modem accepts a serial data stream
and converts it into an analogue format that matches the transmission medium.
There are many different modulation techniques that can be utilised in a modem.
These techniques are
·
Amplitude shift key modulation(ASK)
·
Frequency shift key modulation(FSK)
·
Binary-phase shift key modulation(BP SK)
·
Quadrature-phase shift key modulation(QP SK)
·
Quadrature amplitude modulation(QAM)
Classification of digital
system
According to the modes
of Modem operation
a. Simplex
b. Half
duplex
c. Full
duplex
According to the modem
interconnection
1. Hard
wired modem
2. Acoustically
coupled modem,
According to the modem data
transmission period
1. Low
speed
2. Medium
speed
3. High
speed
According to the
modulation technique
1. FSK
modulation
2. PSK
modulation
3. Four
phase PSK
4. Eight
phase PSK
5. Quadrature
AM
6. Vestigial
sideband AM
Advantages of digital modulation:
1.
Noise in the system does not have the same
detrimental effect (damage) on the received signal.
2.
It is possible to encode messages in
special ways so that the receiving system can able to detect an error.
3.
Digital modulation and demodulation
circuitry may be easier to implement for certain types of modulation.
4.
Digital signals are easier to combine
together so that they can then be modulated as a group using multiplexing
process.
Disadvantages:
1.
The cost of the conversion process may be
too high.
2.
Requires more bandwidth than amplitude modulation
ASK Modulation
Amplitude-shift
keying (ASK) is a form of modulation that represents digital data as variations
in the amplitude of a carrier wave. The amplitude of an analog carrier signal
varies in accordance with the bit stream (modulating signal), keeping frequency
and phase constant. The level of amplitude can be used to represent binary
logic 0s and 1s. We can think of a carrier signal as an ON or OFF switch. In
the modulated signal, logic 0 is represented by the absence of a carrier, thus
giving OFF/ON keying operation.
Like AM, ASK is
also linear and sensitive to atmospheric noise, distortions, propagation
conditions on different routes in PSTN, etc. Both ASK modulation and
demodulation processes are relatively inexpensive. The ASK technique is also
commonly used to transmit digital data over optical fiber. For LED
transmitters, binary 1 is represented by a short pulse of light and binary 0 by
the absence of light. Laser transmitters normally have a fixed "bias"
current that causes the device to emit a low light level. This low level
represents binary 0, while a higher-amplitude lightwave represents binary 1.
FSK Modulation
Frequency-shift
keying (FSK) is a
frequency modulation scheme in which digital information is transmitted through
discrete frequency changes of a carrier wave. The simplest FSK is binary FSK
(BFSK). BFSK literally implies using a pair of discrete frequencies to transmit
binary (0s and 1s) information. With this scheme, the "1" is called
the mark frequency and the "0" is called the space frequency.
Other
forms of FSK:
Minimum-shift keying
Minimum
frequency-shift keying or minimum-shift keying (MSK) is a particularly
spectrally efficient form of coherent FSK. In MSK the difference between the
higher and lower frequency is identical to half the bit rate. Consequently, the
waveforms used to represent a 0 and a 1 bit differ by exactly half a carrier
period. This is the smallest FSK modulation index that can be chosen such that
the waveforms for 0 and 1 are orthogonal. A variant of MSK called GMSK is used
in the GSM mobile phone standard. FSK is commonly used in Caller ID and remote
metering applications: see FSK standards for use in Caller ID and remote
metering for more details.
Audio FSK
Audio FSK
·
Audio frequency-shift keying (AFSK) is a modulation technique by
which digital data is represented by changes in the frequency (pitch) of an
audio tone, yielding an encoded signal suitable for transmission via radio or
telephone. Normally, the transmitted audio alternates between two tones: one,
the "mark", represents a binary one; the other, the "space",
represents a binary zero.
·
AFSK differs from regular frequency-shift keying in performing
the modulation at baseband frequencies. In radio applications, the
AFSK-modulated signal normally is being used to modulate an RF carrier (using a
conventional technique, such as AM or FM) for transmission.
·
AFSK is not always used for high-speed data communications,
since it is far less efficient in both power and bandwidth than most other
modulation modes. In addition to its simplicity, however, AFSK has the advantage
that encoded signals will pass through AC-coupled links, including most
equipment originally designed to carry music or speech.
PSK Modulation
In this method the phase of the carrier
signal is varying according to the binary level. When binary level is 0 the
carrier will be in the reference phase. When binary level is 1 the carrier
phase will deviate 1800 from reference. Thus whenever the signal level changes
the carrier phase will vary by 180°. This is called as binary PSK. The wave
forms are shown in fig.
However, PSK and FSK systems
are widely used in practice because of their robustness with respect to changes
in their amplitude that may be caused by transmission over a non linear channel
Digital Codes
Introduction:
Different types of equipments are used in
computer systems to send and receive data through the devices like keyboards,
video terminals, printers, paper tape punches and readers and magnetic storage
devices. Each of these types of equipment generates and receives data in the
form of codes.
Some codes are advantageous when used in
different applications. Modern computers can easily deal with different codes
by simply converting them to the code used by the computer. The common codes
used are Baudot code, Binary code, ASCII code, EBCDIC code, Hollerith code etc.
Baudot Code
Introduction:
(Murray codes or International Telegraph Codes) 1845-1903
(Murray codes or International Telegraph Codes) 1845-1903
The Baudot code is a 5-bit code which has
been used in telegraphy and paper-tape systems. There are totally 32 (25= 32)
different code combination's. This is not sufficient to represent the alphabets
(26), numerals (10) and other characters (e.g. +, - , >, This 5 element code
uses Letter shift and figure shift symbols to expand the number of
combination's it can provide. Line A is used for weather Symbols, line B - for
fractions, line C - for communications
The following table explains the Baudot
Code Set. The leftmost bit is the Most Significant Bit (MSB), transmitted last.
The rightmost bit is the Least Significant Bit (LSB), transmitted first. The
associated LETTERS and FIGURES (case) characters are also listed, along with
the hexadecimal representation of the character.
BITS LTRS FIGS HEX
----- ---- ---- ---
00011 A - 03
11001 B ? 19
01110 C : 0E
01001 D $ 09
00001 E 3 01
01101 F ! 0D
11010 G & 1A
10100 H STOP 14
00110 I 8 06
01011 J ' 0B
01111 K ( 0F
10010 L ) 12
11100 M . 1C
01100 N , 0C
11000 O 9 18
10110 P 0 16
10111 Q 1 17
01010 R 4 0A
00101 S BELL 05
10000 T 5 10
00111 U 7 07
11110 V ; 1E
10011 W 2 13
11101 X / 1D
10101 Y 6 15
10001 Z " 11
00000 n/a n/a 00
01000 CR CR 08
00010 LF LF 02
00100 SP SP 04
11111 LTRS LTRS 1F
11011 FIGS FIGS 1B
Uses:
Used in telegraph and paper tape systems.
Used in telegraph and paper tape systems.
Drawbacks:
i) It does not provide extra combination of bits to code punctuation and various codes.
ii) All the five bits are used for coding the data. Hence error correction using parity technique is not possible.
i) It does not provide extra combination of bits to code punctuation and various codes.
ii) All the five bits are used for coding the data. Hence error correction using parity technique is not possible.
Limitations:
1. Only 5
bits are available.
2. The
number of combinations are limited only up to 25 = 32 codes.
3. This
code is not sequential.
4. It is
not used for error detection and correction.
ASCII Codes
ASCII stands for the American Standard
Code for Information Interchange, As a standard, ASCII was first adopted in
1963 and quickly became widely used throughout the computer world.
ASCII is a way of defining a set of
characters which can be displayed by a computer on a screen, as well as some
control characters which have special functions. Basic ASCII uses seven bits to
define each letter, meaning it can have up to 128 specific identifiers, two to
the seventh power. This size was chosen based on the common basic block of
computing, the byte, which consists of eight bits. The eighth bit was often set
aside for error-checking functions, leaving seven remaining for a character
set.
Thirty-three codes in ASCII are used to
represent things other than specific characters. The first 32 (0-31) represent
things ranging from a chime sound, to a line feed command, to the start of a
header. The final code, 127, represents a backspace. Beyond the first 31 bits
are the printable characters. Bits 48-57 represent the numeric digits. Bits
65-90 are the capital letters, while bits 97-122 are the lower-case letters.
The rest of the bits are symbols of punctuation, mathematical symbols, and
other symbols such as the pipe and tilde.
Standard ASCII table:
Extended ASCII Table:
Advantages:
i.) Error detection can be achieved by increasing the total numbers of bits of 8. The parity bit is added as the 8th bit, usually the MSB.
ii.) It can be easily used in a computer. Modern computer uses hexadecimal code for their internal computations. Since ASCII is an 8 bit code with parity bit, it can be easy accommodated in computer as 8-bit data.
i.) Error detection can be achieved by increasing the total numbers of bits of 8. The parity bit is added as the 8th bit, usually the MSB.
ii.) It can be easily used in a computer. Modern computer uses hexadecimal code for their internal computations. Since ASCII is an 8 bit code with parity bit, it can be easy accommodated in computer as 8-bit data.
Use:
It is widely use in modern computers
It is widely use in modern computers
EBCBIC Code
EBCDIC code
stands for Extended Binary Coded Decimal Inter
Change code. It is also based on the binary coded decimal
format. It is an 8 bit code. Here all the 8 bits are used for representing the
information. This code also follows a standard binary progression for coding.
This code has totally 256 combinations. In this code, the letter ‘A’ is
represented as ‘1100 1000’ and ‘J’ is represented as 1101 1000. Here the last
two bits are same, but the first 4 bits change progressively from 0000 to 1111.
To represent letter A, the code is 1100 1000, and to represent letter B, the
code is 1100 0100. Here the first 4 bits are same, but last 4 bits vary. Here
also it varies progressively from 0000 to 1111, in reverse direction.
Advantages:
1. It is
similar to ASCII code. It can be readily used in telegraph and computer.
2. Total
number of combinations is higher.
Disadvantages
Here all the 8-bits are used for data
encoding. There is no provision for parity bit. Here error correction is not
possible.
BCD Code
BCD stands for Binary
Coded Decimal numbers. If 8 bits are used, then 256
combinations are possible.
For representing numbers,
the binary code was modified so that only the lower 4 bits are needed. The
sequence was a second 8 bit word to represent each successive decimal column.
As one binary word reaches decimal number 10, it returns to zero and a carry is
added to next word. The number 9567 is represented as
1001 0101 01100111
1001 0101 01100111
An extension of BCD
code is alphanumeric code. Two extra bits are needed to represent letters and
punctuation marks. Seventh bit is added to provide parity bit for error
detection. BCD encoding is used for data representation on magnetic tape.
Recording of data is made on several tracks. An ‘1’ results in magnetized spot
on the tape: A ‘0’ leaves the spot unmagnetized.
Disadvantages:
Unmodified 8 bit code did not
permit any means of error detection. Hence we have to add a parity bit for
error detection.
CDMA
Code division multiple access (CDMA) is a
channel access method utilized by various radio communication technologies. It
should not be confused with the mobile phone standards called cdmaOne and
CDMA2000 (which are often referred to as simply "CDMA"), which use
CDMA as an underlying channel access method.
One of the basic concepts in data
communication is the idea of allowing several transmitters to send information
simultaneously over a single communication channel. This allows several users
to share a bandwidth of different frequencies. This concept is called
multiplexing. CDMA employs spread-spectrum technology and a special coding
scheme (where each transmitter is assigned a code) to allow multiple users to
be multiplexed over the same physical channel. By contrast, time division
multiple access (TDMA) divides access by time, while frequency-division
multiple access (FDMA) divides it by frequency. CDMA is a form of
"spread-spectrum" signaling, since the modulated coded signal has a
much higher data bandwidth than the data being communicated.
An analogy to the problem of multiple
access is a room (channel) in which people wish to communicate with each other.
To avoid confusion, people could take turns speaking (time division), speak at
different pitches (frequency division), or speak in different languages (code
division). CDMA is analogous to the last example where people speaking the same
language can understand each other, but not other people. Similarly, in radio
CDMA, each group of users is given a shared code. Many codes occupy the same
channel, but only users associated with a particular code can understand each
other.
FDMA
Frequency
Division Multiple Access or FDMA is a channel access method used in
multiple-access protocols as a channelization protocol. FDMA gives users an
individual allocation of one or several frequency bands, or channels. Multiple
Access systems coordinate access between multiple users. The users may also
share access via different methods such as TDMA, CDMA, or SDMA. These protocols
are utilized differently, at different levels of the theoretical OSI model. Disadvantage:Crosstalk
which causes interference on the other frequency and may disrupt the
transmission.
Features:
·
FDMA requires high-performing filters in the radio hardware, in
contrast to TDMA and CDMA.
·
FDMA is not vulnerable to the timing problems that TDMA has.
Since a predetermined frequency band is available for the entire period of
communication, stream data (a continuous flow of data that may not be packetized)
can easily be used with FDMA.
·
Due to the frequency filtering, FDMA is not sensitive to
near-far problem which is pronounced for CDMA.
·
Each user transmits and receives at different frequencies as
each user gets a unique frequency slot
It is important to distinguish between
FDMA and frequency-division duplexing (FDD). While FDMA allows multiple users
simultaneous access to a certain system, FDD refers to how the radio channel is
shared between the uplink and downlink (for instance, the traffic going back
and forth between a mobile-phone and a base-station). Furthermore,
frequency-division multiplexing (FDM) should not be confused with FDMA. The
former is a physical layer technique that combines and transmits low-bandwidth
channels through a high-bandwidth channel. FDMA, on the other hand, is an
access method in the data link layer.
FDMA also supports demand assignment
in addition to fixed assignment. Demand assignment allows all users apparently
continuous access of the radio spectrum by assigning carrier frequencies on a
temporary basis using a statistical assignment process. The first FDMA
demand-assignment system for satellite was developed by COMSAT for use on the
Intelsat series IVA and V satellites.
TDMA
Time division multiple access (TDMA) is a channel access method for shared
medium networks. It allows several users to share the same frequency channel by
dividing the signal into different time slots. The users transmit in rapid
succession, one after the other, each using his own time slot. This allows
multiple stations to share the same transmission medium (e.g. radio frequency
channel) while using only a part of its channel capacity. TDMA is used in the
digital 2G cellular systems such as Global System for Mobile Communications
(GSM), IS-136, Personal Digital Cellular (PDC) and iDEN, and in the Digital
Enhanced Cordless Telecommunications (DECT) standard for portable phones. It is
also used extensively in satellite systems, and combat-net radio systems. For
usage of Dynamic TDMA packet mode communication, see below.