Lecture 1

You might also like

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 18

 A block diagram of digital computer is shown

in Fig 1.1

 The memory unit stores programs as well as


input, output, and intermediate data

 The processor unit performs arithmetic and


other data processing tasks as specified by
the program.

 The control unit supervises the flow of


information between the various units
 The input and output devices are special digital
systems driven by electromechanical parts and
controlled by electronic digital circuits.

 A digital computer can accommodate many


input and output devices.

 It can perform not only arithmetic


computations, but logical operations as well

 And can be programmed to make decisions


based on internal and external conditions
 For each instruction, the control unit informs the
processor to execute the operation specified by the
instruction.

 Both program and data are stored in the memory.

 The control unit supervises the program instructions.

 The processor manipulates the data as specified by


the program.

 The program and data prepared by the user are


transferred into the memory unit by means of an
input devise such as keyboard.

 An output device, such as the printer, receives the


result of the computations and the printed results are
presented to the user.
 This
chapter is an introduction to the
decimal, binary, octal, and hexadecimal
numbers, their representation, and
conversion from one base to another.
 The familiar decimal number system has base or
radix 10.

 It
referred to as base 10 because it uses
ten digits 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9.

 These digits are referred to as the coefficients of


the decimal system.
 Thus, in the decimal system the coefficients are

multiplied by the appropriate powers of10 to


form a number.
 For example, the decimal number 58, 392.46 is
 58, 392.46 = 50, 000 + 8, 000 + 300 + 90 + 2
+ 0.4 + 0.06

=5x +8x + 3x + 9x + 2x +4x

+6x
 In general, any number may be represented by

a series of coefficients as:

 ........ .......
 In the decimal system, the coefficients are
the ten coefficients (zero through nine), and
the subscript value denotes the power of ten
by which the coefficient must be multiplied.

 Thus, the last expression above can also be


written as

 . + . + . +.....+ . + . +

 . + . +.....+ .
 Digital computers use the binary (base 2) system which has only two coefficients, 0 and 1.

 In the binary system each coefficient is multiplied by . In general, a number of base or


radix r with
Coefficients is expressed as

. + . + . +....+ . + .

+ . + . +....+ .
 The number 110010.01 could be interpreted
as a binary, or decimal or any other base
number since the coefficients 0 and 1 are
valid in any number with base 2 or above.

 Therefore,it is a recommended practice to


enclose the number in parenthesis and write
a subscript representing the base of the
number.

 Thus,if the number 110010.01 is binary, it


is denoted as
 But
if it is a decimal number, it should be
denoted as

 Two other numbers of interest are the octal


(base 8) and hexadecimal (base 16).

 Theoctal system uses the coefficients 0


through 7.

 Thus, the number 5467.42 can be either an


octal number or a decimal number
 Accordingly,
if it is an octal number, it must
be denoted as

 But
if it is a decimal number, it must be
denoted as

 The
hexadecimal number system uses the
numbers 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9

 And for the remaining six numbers uses the


letters A, B, C, D, E, and F
 Corresponding to the decimal numbers 10, 11,
12, 13, 14, and 15 respectively

 Table1.1 shows the first 16 numbers of


the decimal, binary, octal, and
hexadecimal systems
Decimal Binary Octal Hexadecimal
(Base 10) (Base 2) (Base 8) (Base 16)
0 0 0 0
1 1 1 1
2 10 2 2
3 11 3 3
4 100 4 4
5 101 5 5
6 110 6 6
7 111 7 7
8 1000 10 8
9 1001 11 9
10 1010 12 A
11 1011 13 B
12 1100 14 C
13 1101 15 D
14 1110 16 E
A number in base other than base 10, can be
converted to its decimal equivalent using the
following
steps:

 1.Express the given number in the form of


(1.1).

 2.
Add the terms following the rules of
decimal addition.
 Example 1.1

 Convert the binary number to its decimal


equivalent.

 =1x +1x +1x +1x +1x

 +1x +1x

 = 8 + 4 + 0 + 1 + 0.5 + 0 + 0.125=
 Convert the octal number to its
decimal equivalent.
 Solution:

 = 5x +4x +0x +6x

 =5 × 64+ 4 × 8+ 0 × 1+ 6x

 =
 Convert the hexadecimal number to
its decimal equivalent.

 Solution:

 =D X +B X +0 X +A X

 = 13 × 256+ 11 × 16+ 0 × 1+ 10×

 =

You might also like