CyberArmy Academy | CyberArmy Services & Support | Open Source Institute | CyberArmy Intelligence & Security | CyberArmy Projects

[Library Index]

[View category: Hardware] [Discuss Article]

CAAHP Digital Computer Electronics: Chapter 1

Article is yet to be rated
Author:      PixieLuv
Submitted:      02-Feb-2006 15:14:40
Imported From:      The CyberArmy University (original author: PixieLuv)


Digital Computer Electronics, Chapter One: Number Systems and Codes.
Most textbooks on digital electronics and computer operation are sometimes hard to understand, in this course I'm trying to simplify everything as much as I can to make it easier on people willing to learn and succeed in such a field. I'm dividing this course into chapters, each chapter is dependent on the chapters before, so you have to keep up with me chapter by chapter, ok? Let's start.

00. Opening

Modern computers don't work with decimal numbers. Instead, they process ''binary numbers'', groups of 0s and 1s. Why binary numbers? This is because electronic devices are most reliable when designed for two-state (binary) operation. In this chapter we will discuss the concepts needed to understand computer operation as well as number systems and how to convert from one system to another.

01. What are computers? How they work?

The word computer is misleading as it suggests a machine that can only solve numerical problems, that's not true. A computer is more than an automatic adding machine. It can play games, translate languages and so on. To suggest this broad range of applications, a computer is often referred to as a data processor.

Data may represent anything ( names, numbers, facts, .... ), but as we said earlier computers can only process binary numbers so before data is processed it's coded in binary form so that a computer can understand it.

Besides the data, there's a program that consists of a set of instructions that tell the computer what to do. Programs also must be coded in binary form before they can be executed. Programs are often referred to as software. On the other hand, the electronic, magnetic and mechanical devices of a computer are known as hardware. Bear in mind that a computer is a pile of "dumb" metal without software.

02. Decimal Number System

Everyone has seen an odometer (miles indicator) in action. When a car is new its odometer starts with (0000), After 1 mile the reading becomes (0001), Successive miles produce (0002, 0003, ...... , 0009) then when the units wheel turns from 9 back to 0, a tab on this wheel forces the tens wheel to advance by 1 and the odometer reads (0010), this action is called reset-and-carry. The numbers on each odometer wheel are called digits. The decimal number system uses ten digits, 0 through 9.

03. Binary Number System

Binary means two, The binary number system uses only two digits, 0 and 1. All other digits (2 through 9) are thrown away. Visualize an odometer whose wheels have only two digits, 0 and 1. When each wheel turns it displays 0, then 1, and the cycle repeats so in a binary odometer (0000) stands for decimal 0, (0001) stands for decimal 1, and (0010) stands for decimal 2. Remember that after the cycle of the 0 and 1, the wheel resets and carries causing the other wheels to change.

In binary numbers, 0 may be expressed in various ways like ( OFF LED, low voltage, .... ). On the other hand 1 may be expressed as ( ON LED, high voltage, .... ). Try to get familiar with binary number system because it's the mainstay of digital design. A binary digit is abbreviated to a bit, a binary number like (1100) has 4 bits, every 4 bits are called a nibble, and every 8 bits are called a byte.

Note that :

1 Kilobyte = 1024 bytes
1 Megabyte = 1024 Kilobytes
1 Gigabyte = 1024 Megabytes
1 Terabyte = 1024 Gigabytes

04. Hexadecimal Number System

Hexadecimal means 16, This means that it uses 16 digits to represent all numbers. The digits are (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F). Following the same reset-and-carry rule we can generate hexadecimal numbers, observe the following table.

Equivalances Table
||Decimal|Binary|Hexadecimal|Decimal|Binary|Hexadecimal||0|0000|0|8|1000|8||2|0001|1|9|1001|9||2|0010|2|10|1010|A||3|0011|3|11|1011|B||4|0100|4|12|1100|C||5|0101|5|13|1101|D||6|0110|6|14|1110|E||7|0111|7|15|1111|F||

05. Base or Radix

The base or radix of a number system equals the number of digits it has. Decimal number system has a base of 10, binary number
system has a base of 2 and hexadecimal number system has a base of 16. A subscript attached to the number indicates the base of that number.

Example:

3010 = 111102 = 1E16
This means that : 30 decimal = 11110 binary = 1E hexadecimal

How these terms are equal? Continue to the next section.

06. Code Conversion

Decimal Weights

The decimal number system is an example of positional notation; each digit position has a weight or value. Here the weights are units, tens, hundreds and so on. Have you ever noticed that the sum of numbers multiplied by their weights gives you the total amount being represented?

5
7
0
4

103
102
101
100

(5 X 103) + (7 X 102) + (0 X 101) + (4 X 100) = 5704

Binary to Decimal Conversion

Positional notation is also used with binary numbers, since only two digits are used, the weights are powers of 2 instead of 10 in the decimal number system so the weights would be 1, 2, 4, 8 and so on. Notice that the weights theory is the same meaning that we start with the lowest weight at the right and move to left direction just like the decimal number system, also the decimal equivalent of the
binary number would be calculated through calculating the sum of the numbers multiplied by their weights.

1
1
0
1

23
22
21
20

(1 X 23) + (1 X 22) + (0 X 21) + (1 X 20) = 13

There's a streamlined way to convert a binary number to its decimal equivalent, just visualize the weights in your mind then calculate the sum of weights that are represented as 1s and discard weights represented as 0s.

Hexadecimal to Decimal Conversion

As we said before the hexadecimal number system also has weights but here the weights are powers of 16, weights can be used easily
to convert hexadecimal numbers to decimal numbers.

C
7
2
F

163
162 161
160

(12 X 163) + (7 X 162) + (2 X 161) + (15 X 160) = 50991

Note that each hexadecimal digit has been transformed first to its decimal equivalent to be able to calculate the shown equation so you must be able to visualize Equivalences Table stated earlier.

Decimal to Binary Conversion

You can convert from decimal number system to binary number system using successive division by 2, writing down each quotient
and its remainder. The remainders are the binary equivalent of the decimal number. Let's go through an example.

Answer is : (1310 =11012).

Another streamlined way to quickly convert from decimal to binary is to visualize the binary weights in your mind and split the decimal number to sum of binary weights and then assign 1 to every weight you found in this process and 0 to weights you discarded.

Decimal to Hexadecimal Conversion

We can also use successive division by 16 to convert from decimal numbers to hexadecimal numbers as follows.

Answer is : (249710= 9AF16).

Binary to Hexadecimal, Hexadecimal to Binary Conversion Conversion between binary and hexadecimal is so easy and is based on
Equivalences Table that was described earlier, all you have to do is to split the binary number into nibbles ( 4-bits each ) and convert the nibbles to hexadecimal through the table and vice versa.

7 F
0111 1111

1101 0010
D 2

07. BCD Numbers

BCD is an abbreviation for (Binary Coded Decimal). In this number system we convert each decimal digit to its corresponding nibble as follows.

4 1 9 6
0100 0001 1001 0110

After completing this chapter you should be able to recognize various number systems and convert between them quickly, so take your time to get familiar to all number systems and conversion methods mentioned here because everything discussed later will be dependent on them, I hope that was a good start, I will publish the upcoming chapters one be one as soon as I finish them. Next chapter will be about logic gates and how we can design simple digital circuits.

Copyright 2005 [http://caahp.com|CyberArmy Advanced Hardware Projects (CAAHP)]
CAAHP is a part of [http://university.cyberarmy.net/|CyberArmy University (CAU)]

This article was originally published by CyberArmy.net in the CyberArmy Library.

You must be logged in to vote on an article

About Us | Privacy Policy | Mission Statement | Help