You are on page 1of 51

D ig ita l L o g ic a n d D e s ig n

I. N U M B E R S Y S T E M

A . B A C K G R O U N D A N D H IS T O R Y

M a n s' e a r lie s t n u m ber or c o u n t in g sy stem w a s p r o b a b ly


d e v e lo p e d to h e lp d e t e r m in e h ow m a n y p o s s e s s io n s a person h a d. A s
d a ily a c t iv it ie s b e c a m e m o r e c o m p le x , n u m b e r s b e c a m e m o r e im p o r t a n t
in t r a d e , t im e , d is t a n c e , a n d a ll o t h e r p h a s e s o f h u m a n life .

A s you h a ve seen a lr e a d y , n u m b e r s a re e x t r e m e ly im p o r t a n t in
y o u r m ilit a r y a n d p e r s o n a l life . Y ou r e a liz e t h a t you n eed m ore th a n
y o u r fin g e r s a n d t o e s t o k e e p t r a c k o f t h e n u m b e r s in y o u r d a ily r o u t in e .

E ver s in c e p e o p le d is c o v e r e d th a t it w a s n ecessa ry to cou n t


o b je c t s , th ey h a ve been lo o k in g fo r e a s ie r w a ys to cou n t th em . Th e
a ba cu s, d e v e lo p e d by th e C h in e s e , is on e of th e e a r lie s t kn ow n
c a lc u la t o r s . It is s t ill in u s e in s o m e p a r t s o f t h e w o r ld .

T h e fir s t a d d in g m a c h in e w a s in v e n t e d b y B la is e P a s c a l (F r e n c h )

in 1642. T w en ty yea rs la t e r , a n E n g lis h m a n , S ir S a m u el M o r e la n d ,


d e v e lo p e d a m ore com pa ct d e v ic e th a t c o u ld m u lt ip ly , a dd, a n d
s u b t r a c t . A b o u t 1 6 7 2 , G o t t fr ie d W ilh e lm v o n L e ib n iz (G e r m a n ) p e r fe c t e d
a m a c h in e t h a t c o u ld p e r fo r m a ll t h e b a s ic o p e r a t io n s (a d d , s u b t r a c t ,
m u lt ip ly , d iv id e ), a s w e ll a s e x t r a c t t h e s q u a r e r o o t . M o d e r n e le c t r o n ic
d ig it a l c o m p u t e r s s t ill u s e v o n L i e b n i z 's p r i n c i p l e s .

B . M O D E R N U S E

C om p u ters a re n ow e m p lo y e d w h erever rep ea ted c a lc u la t io n s o r


th e p r o c e s s in g of h u ge a m ou n ts of d a ta is n eeded. Th e g rea test
a p p lic a t io n s a r e fo u n d in t h e m ilit a r y , s c ie n t ific , a n d c o m m e r c ia l fie ld s .
Th ey h a ve a p p lic a t io n s th a t ra n ge fr o m m a il s o r t in g , th rou gh
e n g in e e r in g d e s ig n , to th e id e n t ific a t io n a n d d e s t r u c t io n o f en em y

ta rg ets. T h e a d v a n t a g e s o f d ig it a l c o m p u t e r s in c lu d e speed, a ccu ra cy,


a n d m a n - p o w e r s a v in g s . O ft e n c o m p u t e r s a r e a b le t o t a k e o v e r r o u t in e
jo b s a n d r e le a s e p e r s o n n e l fo r m o r e im p o r t a n t w o r k - w ork th a t ca n n ot
b e h a n d le d b y a com p u ter.

P e o p le a n d c o m p u t e r s d o n o t n o r m a lly s p e a k t h e s a m e la n g u a g e.
M e t h o d s o f t r a n s la t in g in fo r m a t io n in t o fo r m s t h a t a r e u n d e r s t a n d a b le
a n d u s a b le to b oth a re n ecessa ry. H u m a n s g e n e r a lly spea k in w ords
a n d n u m bers expressed in th e d e c im a l n u m ber sy stem , w h ile
com p u ters o n ly u n d ersta n d coded e le c t r o n ic p u ls e s th a t represen t
d ig it a l in fo r m a t io n .

F lo r e n c e M . B a n a s ih a n Page 1
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

C . T Y P E S O F N U M B E R S Y S T E M S

U n t il n o w , y o u h a v e p r o b a b ly u s e d o n ly o n e n u m b e r s y s t e m , t h e
d e c im a l sy stem . Y ou m a y a ls o be fa m ilia r w it h th e R om a n n u m eral
sy stem , even t h o u g h y o u s e ld o m u s e it .

1 . T H E D E C IM A L N U M B E R S Y S T E M

In t h is m o d u le you w ill be s t u d y in g m odern n u m ber

sy stem s. Y ou s h o u ld r e a liz e th a t th ese sy stem s h a ve c e r t a in


t h in g s in c o m m o n . T h e s e c o m m o n t e r m s w ill b e d e fin e d u s in g t h e
d e c im a l s y s t e m a s ou r ba se. E a ch term w ill b e r e la t e d to ea ch
n u m b er sy stem a s th a t n u m b er sy stem is in t r o d u c e d .

E a ch o f t h e n u m b e r s y s t e m s y o u w ill s t u d y is b u ilt a r o u n d
th e fo llo w in g com p on en ts: th e U N IT , N U M B E R , a n d B A S E
(R A D IX ).

a . U n it a n d N u m b e r

Th e term s u n it a n d num ber w h en u sed w it h th e d ecim a l


sy stem a re a lm o s t s e lf- e x p la n a t o r y . B y d e fin it io n th e u n it is a
s in g le o b je c t ; t h a t is , a n a p p le , a d o lla r , a da y. A n u m ber is a
s y m b o l r e p r e s e n t in g a u n it o r a q u a n t it y . T h e fig u r e s 0 , 1 , 2 , a n d

3 th rou g h 9 a r e t h e s y m b o ls u s e d in t h e d e c im a l s y s t e m . T h e s e
s y m b o ls a re c a lle d A r a b ic n u m e r a ls or fig u r e s . O th er s y m b o ls
m a y be u sed fo r d iffe r e n t n u m ber sy stem s. F or e x a m p le , th e
s y m b o ls u s e d w it h t h e R o m a n n u m era l sy stem a r e le t t e r s - V is
t h e s y m b o l fo r 5 , X fo r 1 0 , M fo r 1 ,0 0 0 , a n d s o fo r t h . W e w ill u s e
A r a b ic n u m e r a ls a n d le t t e r s in t h e n u m b e r s y s t e m d is c u s s io n s in
t h is c h a p t e r .

b. B a se (R a d ix )

Th e ba se, or r a d ix , of a n u m ber sy stem t e lls you th e


n u m b e r o f s y m b o ls u s e d in t h a t s y s t e m . T h e b a s e o f a n y s y s t e m
is a lw a y s e x p r e s s e d in d e c im a l n u m b e r s . Th e ba se, or r a d ix , o f

t h e d e c im a l s y s t e m is 1 0 . T h is m ea n s th ere a re 1 0 s y m b o ls - 0,
1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , a n d 9 - u s e d in t h e s y s t e m . A n u m b e r s y s t e m
u s in g t h r e e s y m b o ls - 0 , 1 , a n d 2 - w o u ld b e b a s e 3 ; fo u r s y m b o ls
w o u ld b e b a s e 4 ; a n d s o fo r t h . R e m e m b e r t o c o u n t t h e z e r o o r t h e
sym bol u sed fo r z e r o w h en d e t e r m in in g t h e n u m b e r o f s y m b o ls
u s e d in a n u m b er sy stem .

Th e ba se of a n u m ber sy stem is in d ic a t e d by a s u b s c r ip t
(d e c im a l n u m ber) fo llo w in g th e v a lu e of th e n u m ber. Th e

F lo r e n c e M . B a n a s ih a n Page 2
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

fo llo w in g a r e e x a m p le s o f n u m e r ic a l v a lu e s in d iffe r e n t b a s e s w ith


t h e s u b s c r ip t t o in d ic a t e t h e b a s e :

Y ou s h o u ld n o t ic e th e h ig h e s t v a lu e sym bol u sed in a


n u m b er sy stem is a lw a y s o n e le s s th a n th e b a se of th e sy stem .
In ba se 10 t h e la r g e s t v a lu e s y m b o l p o s s ib le is 9 ; in ba se 5 it is
4 ; in b a s e 3 it is 2 .

c . P o s it io n a l N o t a t io n a n d Z e ro

Y ou m u st observe t w o p r in c ip le s w h en c o u n t in g o r w r it in g
q u a n t it ie s or n u m e r ic a l v a lu e s . Th ey a re th e P O S IT IO N A L
N O T A T IO N a n d th e Z E R O p r in c ip le s .

P o s it io n a l n o t a t io n is a s y s t e m w h e r e t h e v a lu e o f a n u m b e r
is d e fin e d n o t o n ly by th e sym bol bu t by t h e s y m b o l 's p o s it io n .
L e t 's e x a m in e th e d e c im a l (b a s e 10) v a lu e of 4 2 7 .5 . Y ou kn ow
fr o m e x p e r ie n c e t h a t t h is v a lu e is fo u r h u n d r e d t w e n t y - s e v e n a n d
o n e - h a lf. N o w e x a m in e t h e p o s it io n of ea ch n u m ber:

If 4 2 7 .5 is th e q u a n t it y you w is h to express, th en ea ch
n u m ber m u st be in th e p o s it io n sh ow n . If you exch a n ge th e
p o s it io n s o f t h e 2 a n d t h e 7 , t h e n y o u c h a n g e t h e v a lu e .

E a ch p o s it io n in t h e p o s it io n a l n o t a t io n s y s t e m represen ts
a p o w e r o f t h e b a s e , o r r a d ix . A P O W E R is t h e n u m b e r o f t im e s a
b a s e is m u lt ip lie d b y it s e lf. T h e p o w e r is w r it t e n a b o v e a n d t o t h e

r ig h t of th e ba se a n d is c a lle d a n E X PO N E N T. E x a m in e th e
fo llo w in g b a s e 1 0 lin e g r a p h :

F lo r e n c e M . B a n a s ih a n Page 3
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

N ow l e t 's lo o k a t th e v a lu e o f th e ba se 10 n u m ber 4 2 7 .5
w it h t h e p o s it io n a l n o t a t io n lin e g r a p h :

Y o u c a n s e e t h a t t h e p o w e r o f t h e b a s e is m u lt ip lie d b y t h e
n u m b e r in t h a t p o s it io n t o d e t e r m in e t h e v a lu e fo r t h a t p o s it io n .

T h e fo llo w in g g r a p h illu s t r a t e s t h e p r o g r e s s io n of pow ers of 10:

A ll n u m bers to th e le ft of th e d e c im a l p o in t a re w h o le
n u m bers, a n d a ll n u m b e r s t o t h e r ig h t o f t h e d e c im a l p o in t a r e
fr a c t io n a l n u m b e r s . A w h o le n u m b e r is a s y m b o l t h a t r e p r e s e n t s
on e, or m ore, c o m p le t e o b je c t s , su ch a s on e a p p le or $5. A
fr a c t io n a l n u m b e r is a sym bol th a t rep resen ts a p o r t io n of a n
o b je c t , s u c h a s h a lf o f a n a p p le (.5 a p p le s ) o r a q u a r t e r o f a d o lla r
($ 0 .2 5 ). A m ix e d n u m ber rep resen ts on e, or m ore, c o m p le t e

F lo r e n c e M . B a n a s ih a n Page 4
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

o b je c t s , a n d som e p o r t io n of a n o b je c t , su ch a s on e a n d a h a lf
a p p le s (1 .5 a p p le s ). W h en you u se a n y ba se oth er th a n th e
d e c im a l sy stem , th e d iv is io n b etw een w h o le n u m bers a n d
fr a c t io n a l n u m bers is r e fe r r e d to a s th e R A D IX P O IN T . Th e
d e c im a l p o in t is a c t u a lly t h e r a d ix p o in t o f t h e d e c im a l s y s t e m ,
b u t th e term r a d ix p o in t is n o r m a lly n ot u sed w it h th e b a se 10

n u m b er sy stem .

J u s t a s im p o r t a n t a s p o s it io n a l n o t a t io n is t h e u s e o f t h e
zero. Th e p la c e m e n t o f t h e z e r o in a n u m ber ca n h a ve q u it e a n
e ffe c t on t h e v a lu e b e in g r e p r e s e n t e d . S o m e t im e s a p o s it io n in a
n u m ber does n ot h a ve a v a lu e b etw een 1 a n d 9 . C o n s id e r h ow
t h is w o u ld a ffe c t you r n ext pa ych eck. If you w ere e x p e c t in g a
c h e c k f o r $ 6 0 5 . 4 7 , y o u w o u l d n 't w a n t i t t o b e $ 6 5 . 4 7 . L e a v i n g o u t
t h e z e r o in t h is c a s e m e a n s a d iffe r e n c e o f $ 5 4 0 .0 0 . I n t h e n u m b e r
6 0 5 .4 7 , t h e z e r o in d ic a t e s t h a t t h e r e a r e n o t e n s . I f y o u p la c e t h is
v a lu e o n a ba r gra ph , you w ill s e e th a t th ere a re n o m u lt ip le s o f
1
10 .

M o s t S ig n ific a n t D ig it a n d L e a s t S ig n ific a n t D ig it (M S D a n d
L S D ) O t h e r im p o r t a n t fa c t o r s o f n u m b e r s y s t e m s t h a t y o u s h o u ld
r e c o g n iz e a re th e M O S T S IG N IF IC A N T D IG IT (M S D ) a n d th e
L E A S T S IG N IF IC A N T D IG IT (L S D ).

Th e M S D in a n u m ber is th e d ig it th a t h a s th e g re a te s t

e ffe c t o n th a t n u m b er.

Th e LS D in a n u m b e r is t h e d ig it t h a t h a s t h e le a s t e ffe c t
on th a t n u m b er.

L o o k a t t h e fo llo w in g e x a m p le s :

F lo r e n c e M . B a n a s ih a n Page 5
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

Y ou ca n e a s ily see th a t a ch a n ge in th e M S D w ill in c r e a s e


or decrea se th e v a lu e of th e n u m ber th e g rea test a m o u n t.
C h a n g e s in t h e L S D w ill h a v e t h e s m a lle s t e ffe c t o n t h e v a lu e . T h e
n on zero d ig it o f a n u m b e r t h a t is t h e fa r t h e s t L E F T is t h e M S D ,
a n d th e n on zero d ig it fa r t h e s t R IG H T is th e LS D , a s in th e
fo llo w in g e x a m p le :

In a w h o le n u m ber th e LS D w ill a lw a y s be th e d ig it
im m e d ia t e ly t o t h e le ft o f t h e r a d ix p o in t .

P R O B L E M T S E T N O . 1 (Q 1 - 8 )

1. W h a t term d e s c r ib e s a s in g le o b je c t ?

2. A s y m b o l t h a t r e p r e s e n t s o n e o r m o r e o b je c t s is c a lle d a

_________.

3. T h e s y m b o ls 0 , 1 , 2 , a n d 3 t h r o u g h 9 a re w h a t ty p e of

n u m e r a ls ?

4. W h a t d o e s t h e b a s e , o r r a d ix , o f a n u m b e r s y s t e m t e lls y o u

a b ou t th e sy stem ?

5. H ow w o u ld y o u w r it e o n e h u n d r e d seven ty -th ree b a se 1 0 ?

6. W h a t p o w e r o f 1 0 is e q u a l t o 1 ,0 0 0 ? 100? 10? 1?

7. T h e d e c im a l p o in t o f t h e b a s e 1 0 n u m b e r s y s t e m is a ls o

kn ow n a s th e _________.

8. W h a t is t h e M S D a n d LS D o f t h e fo llo w in g n u m b e r s ?

(a ) 4 2 0 . (b ) 1 0 4 5 .0 6 (c ) 0 .0 0 2 4 (d ) 2 4 7 .0 0 0 1

F lo r e n c e M . B a n a s ih a n Page 6
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

2 . T H E B IN A R Y N U M B E R S Y S T E M

Th e s im p le s t p o s s ib le n u m ber sy stem is th e B IN A R Y , o r
ba se 2, sy stem . Y ou w ill be a b le to u se th e in fo r m a t io n ju s t
covered a b o u t t h e d e c im a l s y s t e m t o e a s ily r e la t e t h e s a m e t e r m s
t o t h e b in a r y s y s t e m .

a . U n it a n d N u m b e r

T h e b a s e o r r a d ix - y o u s h o u ld r e m e m b e r fr o m o u r d e c im a l
s e c t io n - is t h e n u m b e r o f s y m b o ls u sed in th e n u m b er sy stem .
S in c e t h is is t h e b a s e 2 s y s t e m , o n ly t w o s y m b o ls , 0 a n d 1, a re
u sed. Th e ba se is in d ic a t e d by a s u b s c r ip t , a s sh ow n in th e
fo llo w in g e x a m p le :

W h en you a re w o r k in g w it h th e d e c im a l sy stem , you


n o r m a lly d o n 't u s e th e s u b s c r ip t . N ow th a t y ou w ill b e w o r k in g
w it h n u m ber sy stem s oth er th a n th e d e c im a l sy stem , it is
im p o r t a n t t h a t y o u u s e t h e s u b s c r ip t s o th a t y ou a re su re of th e
sy stem b e in g r e fe r r e d t o . C o n s id e r t h e fo llo w in g t w o n u m b e r s :

W it h n o s u b s c r ip t y o u w o u ld a s s u m e b o t h v a lu e s w e r e t h e
sa m e. If you a dd s u b s c r ip t s to in d ic a t e t h e ir ba se sy stem , a s
sh ow n b e lo w , t h e n t h e ir v a lu e s a r e q u it e d iffe r e n t :

Th e ba se ten n u m ber 11 10 is e le v e n , bu t th e ba se tw o
n u m ber 11 2 is o n ly eq u a l to th ree in ba se ten . Th ere w ill b e
o c c a s io n s w h e n m ore th a n on e n u m b er sy stem w ill b e d is c u s s e d
a t t h e s a m e t im e , s o y o u M U S T u s e t h e p r o p e r s u b s c r ip t .

b. P o s it io n a l N o t a t io n

A s in th e d e c im a l n u m ber sy stem , th e p r in c ip le of

p o s it io n a l n o t a t io n a p p lie s to th e b in a r y n u m ber sy stem . Y ou


s h o u ld r e c a ll th a t th e d e c im a l sy stem u ses pow ers of 10 to
d e t e r m in e t h e v a lu e o f a p o s it io n . T h e b in a r y s y s t e m u ses pow ers
o f 2 t o d e t e r m in e t h e v a lu e o f a p o s it io n . A b a r g r a p h s h o w in g t h e
p o s it io n s a n d t h e p o w e r s o f t h e b a s e is s h o w n b e lo w :

F lo r e n c e M . B a n a s ih a n Page 7
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

A ll n u m b e r s o r v a lu e s t o t h e le ft o f t h e r a d ix p o in t a r e w h o le

n u m bers, a n d a ll n u m bers to th e r ig h t of th e r a d ix p o in t a re
fr a c t io n a l n u m b e r s .

L e t 's l o o k a t t h e b i n a r y n u m b e r 1 0 1 . 1 on a ba r gra ph :

W o r k in g fr o m t h e r a d ix p o in t t o t h e r ig h t a n d le ft , y o u c a n
d e t e r m in e t h e d e c im a l e q u iv a le n t :

T a b le 1 -2 p r o v id e s a c o m p a r is o n of d e c im a l a n d b in a r y
n u m bers. N o t ic e th a t ea ch t im e th e tota l n u m ber of b in a r y
s y m b o l p o s it io n s in c r e a s e s , t h e b in a r y n u m b e r in d ic a t e s t h e n e x t
h ig h e r p o w e r o f 2 . B y t h is e x a m p le , y o u ca n a ls o see th a t m ore
sym bol p o s it io n s a re n eeded in th e b in a r y sy stem to represen t
t h e e q u iv a le n t v a lu e in t h e d e c im a l s y s t e m .

T a b le 1 -2 . - D e c im a l a n d B in a r y C o m p a r is o n

F lo r e n c e M . B a n a s ih a n Page 8
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

c . M S D a n d L S D

W h en y o u 'r e d e t e r m in in g th e M S D a n d LS D fo r b in a r y
n u m bers, u se th e sa m e g u id e lin e s you u sed w it h th e d e c im a l
sy stem . A s y ou r e a d fr o m le ft t o r ig h t , t h e fir s t n o n z e r o d ig it y o u
e n c o u n t e r is t h e M S D , a n d t h e la s t n o n z e r o d ig it is t h e L S D .

If t h e n u m b e r is a w h o le n u m b e r , t h e n t h e fir s t d ig it t o t h e
le ft o f t h e r a d ix p o in t is t h e L S D .

F lo r e n c e M . B a n a s ih a n Page 9
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

H e r e , a s in t h e d e c im a l s y s t e m , t h e M S D is t h e d ig it t h a t
w ill h a v e t h e m o s t e ffe c t o n t h e n u m b e r ; t h e L S D is t h e d ig it t h a t
w ill h a v e t h e le a s t e ffe c t o n th e n u m b er.

T h e t w o n u m e r a ls o f t h e b in a r y s y s t e m (1 a n d 0 ) c a n e a s ily
be rep resen ted by m a n y e le c t r ic a l or e le c t r o n ic d e v ic e s . F or
e x a m p le , 1 2 m a y b e in d ic a t e d w h e n a d e v ic e is a c t iv e (o n ), a n d 0 2

m a y b e in d ic a t e d w h e n a d e v ic e is n o n - a c t iv e (o ff).

Look a t th e p r e c e d in g fig u r e . It illu s t r a t e s a very s im p le


b in a r y c o u n t in g d e v ic e .N o t ic e th a t 1 2 is in d ic a t e d by a lig h t e d
la m p a n d 0 2 is in d ic a t e d bya n u n lig h t e d la m p . T h e reverse w ill
w o r k e q u a lly w e ll. T h e u n lig h t e d s t a t e o f t h e la m p c a n b e u s e d t o
represen t a b in a r y 1 c o n d it io n , a n d th e lig h t e d sta te ca n
r e p r e s e n t t h e b in a r y 0 c o n d it io n . B o t h m e t h o d s a r e u s e d in d ig it a l
c o m p u t e r a p p lic a t io n s . M a n y o t h e r d e v ic e s a r e u sed to rep resen t
b in a r y c o n d it io n s . Th ey in c lu d e s w it c h e s , r e la y s ,
d io d e s ,t r a n s is t o r s , a n d in t e g r a t e d c ir c u it s (I C s ).

3 . O C T A L N U M B E R S Y S T E M

T h e o c t a l, o r b a s e 8 , n u m b e r s y s t e m is a com m on sy stem
u s e d w it h c o m p u t e r s . B e c a u s e o f it s r e la t io n s h ip w it h t h e b in a r y
s y s t e m , it is u s e fu l in p r o g r a m m in g s o m e t y p e s o f c o m p u t e r s .

L o o k c lo s e ly a t t h e c o m p a r is o n o f b in a r y a n d o c t a l n u m b e r
sy stem s in t a b le 1 -3 . Y ou ca n see th a t on e octa l d ig it is th e

F lo r e n c e M . B a n a s ih a n Page 10
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

e q u iv a le n t v a lu e o f t h r e e b in a r y d ig it s . T h e fo llo w in g e x a m p le s o f
th e c o n v e r s io n of octa l 225 8 to b in a r y a n d ba ck a g a in fu r t h e r
illu s t r a t e t h is c o m p a r is o n :

T a b le 1 -3 . - B in a r y a n d O c ta l C o m p a ris o n

a . U n it a n d N u m b e r

Th e term s th a t you le a r n e d in th e d e c im a l a n d b in a r y
s e c t io n s a r e a ls o u s e d w it h t h e o c t a l s y s t e m .

T h e u n it r e m a in s a s in g le o b je c t , a n d t h e n u m b e r is s t ill a
s y m b o l u s e d t o r e p r e s e n t o n e o r m o r e u n it s .

b. B a se (R a d ix )

F lo r e n c e M . B a n a s ih a n Page 11
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

A s w it h t h e o t h e r s y s t e m s , t h e r a d ix , o r b a s e , is t h e n u m b e r
of s y m b o ls u sed in th e sy stem . Th e octa l sy stem u ses e ig h t
s y m b o ls - 0 th rou g h 7. Th e ba se, or r a d ix , is in d ic a t e d by th e
s u b s c r ip t 8 .

c . P o s it io n a l N o t a t io n

Th e octa l n u m b er sy stem is a p o s it io n a l n o t a t io n n u m ber

sy stem . J u st a s th e d e c im a l s y s t e m u ses pow ers of 10 a n d th e


b in a r y s y s t e m u ses p ow ers of 2 , th e octa l sy stem u ses pow er of 8
t o d e t e r m in e t h e v a lu e o f a n u m b e r 's p o s i t i o n . T h e f o l l o w i n g b a r
g r a p h s h o w s t h e p o s it io n s a n d t h e p o w e r o f t h e b a s e :

R em em ber, th a t th e pow er, or exp on en t, in d ic a t e s th e


n u m b e r o f t im e s t h e b a s e is m u lt ip lie d b y it s e lf. T h e v a lu e o f t h is
m u lt ip lic a t io n is e x p r e s s e d in b a s e 1 0 a s sh ow n b e lo w :

A ll n u m bers to th e le ft of th e r a d ix p o in t a re w h o le
n u m b e r s , a n d t h o s e t o t h e r ig h t a r e fr a c t io n a l n u m b e r s .

F lo r e n c e M . B a n a s ih a n Page 12
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

d . M S D a n d L S D

W h en d e t e r m in in g th e m ost a n d le a s t s ig n ific a n t d ig it s in
a n o c t a l n u m b e r , u s e t h e s a m e r u le s t h a t y o u u s e d w it h t h e o t h e r
n u m b e r s y s t e m s . T h e d ig it fa r t h e s t t o t h e le ft o f t h e r a d ix p o in t is
t h e M S D , a n d t h e o n e fa r t h e s t r ig h t o f t h e r a d ix p o in t is t h e L S D .

E x a m p le :

If t h e n u m b e r is a w h o le n u m b e r , t h e M S D is t h e n o n z e r o

d ig it fa r t h e s t t o t h e le ft o f t h e r a d ix p o in t a n d t h e L S D is t h e d ig it
im m e d ia t e ly to th e le ft of th e r a d ix p o in t . C o n v e r s e ly , if th e
n u m b e r is a fr a c t io n o n ly , t h e n o n z e r o d ig it c lo s e s t to t h e r a d ix
p o in t is t h e M S D a n d th e L S D is t h e n o n z e r o d ig it fa r t h e s t t o t h e
r ig h t o f t h e r a d ix p o in t .

4 . H E X A D E C IM A L (H E X ) N U M B E R S Y S T E M

Th e h ex n u m b er sy stem is a m o r e c o m p le x sy stem in u se
w it h com p u ters. Th e n a m e is d e r iv e d fr o m th e fa c t th e sy stem
u ses 16 s y m b o ls . It is b e n e fic ia l in com p u ter p r o g r a m m in g
b e c a u s e o f it s r e la t io n s h ip t o t h e b in a r y s y s t e m . S in c e 1 6 in th e
4
d e c im a l s y s t e m is t h e fo u r t h p o w e r o f 2 (o r 2 ); o n e h e x d ig it h a s

a v a lu e eq u a l to fo u r b in a r y d ig it s . T a b le 1 -5 sh ow s th e
r e la t io n s h ip b e t w e e n th e tw o sy stem s.

F lo r e n c e M . B a n a s ih a n Page 13
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

T a b le 1 -5 . - B in a r y a n d H e x a d e c im a l C o m p a ris o n

a . U n it a n d N u m b e r

A s in ea ch o f t h e p r e v io u s n u m b er sy stem s, a u n it s t a n d s
fo r a s in g le o b je c t .

A n u m ber in th e h ex sy stem is th e sym bol u sed to


represen t a u n it o r q u a n t it y . T h e a r a b ic n u m e r a ls 0 th rou g h 9
a r e u s e d a lo n g w it h t h e fir s t s ix le t t e r s o f t h e a lp h a b e t . Y o u h a v e
p r o b a b ly u sed le t t e r s in m a th p r o b le m s to represen t u n kn ow n
q u a n t it ie s , b u t in th e h ex sy stem A , B , C , D , E , a n d F , ea ch h a ve
a d e fin it e v a lu e a s s h o w n b e lo w :

F lo r e n c e M . B a n a s ih a n Page 14
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

b. B a se (R a d ix )

Th e b a s e , o r r a d ix , o f t h is s y s t e m is 1 6 , w h ic h represen ts
t h e n u m b e r o f s y m b o ls u s e d in t h e s y s t e m . A q u a n t it y e x p r e s s e d
in h e x w ill b e a n n o t a t e d b y t h e s u b s c r ip t 1 6 , a s s h o w n b e lo w :

A 3E F 16

c . P o s it io n a l N o t a t io n

L ik e t h e b in a r y , o c t a l, a n d d e c im a l s y s t e m s , t h e h e x s y s t e m
is a p o s it io n a l n o t a t io n sy stem . Pow ers of 16 a re u sed fo r th e
p o s it io n a l v a lu e s o f a n u m b e r . T h e fo llo w in g b a r g r a p h s h o w s t h e
p o s it io n s :

M u lt ip ly in g th e ba se t im e s it s e lf th e n u m ber of t im e s
in d ic a t e d b y t h e e x p o n e n t w ill s h o w t h e e q u iv a le n t d e c im a l v a lu e :

Y ou ca n see fr o m t h e p o s it io n a l v a lu e s t h a t u s u a lly fe w e r
s y m b o l p o s it io n s a r e r e q u ir e d to express a n u m b e r in h ex th a n
in d e c im a l. T h e fo llo w in g e x a m p le s h o w s t h is c o m p a r is o n :

625 16 is e q u a l t o 1 5 7 3 10

d . M S D a n d L S D

Th e m ost s ig n ific a n t a n d le a s t s ig n ific a n t d ig it s w ill be


d e t e r m in e d in th e sa m e m a n n er a s th e oth er n u m ber sy stem s.

F lo r e n c e M . B a n a s ih a n Page 15
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

Th e fo llo w in g e x a m p le s sh ow th e M S D a n d LS D of w h o le ,
fr a c t io n a l, a n d m ix e d h e x n u m b e r s :

D . C O N V E R S IO N O F B A S E S

W e m e n t io n e d in th e in t r o d u c t io n to t h is ch a p ter th a t d ig it a l
com p u ters op era te on e le c t r ic a l p u ls e s . T h e s e p u ls e s o r t h e a b s e n c e o f,
a re e a s ily rep resen ted by b in a r y n u m bers. A p u ls e ca n represen t a

b in a r y 1 , a n d t h e la c k o f a p u ls e c a n r e p r e s e n t a b in a r y 0 o r v ic e versa .

Th e s e c t io n s of t h is ch a p ter th a t d is c u s s e d octa l a n d h ex
n u m b ers b oth m e n t io n e d t h a t t h e ir n u m b e r s y s t e m s w e r e b e n e fic ia l t o
progra m m ers. Y ou w ill see la t e r in t h is s e c t io n th a t octa l a n d h ex
n u m b e r s a r e e a s ily c o n v e r t e d t o b in a r y n u m b e r s a n d v ic e v e r s a .

If y o u a r e g o in g t o w o r k w it h c o m p u t e r s , t h e r e w ill b e m a n y t im e s
w h en it w ill b e n e c e s s a r y t o c o n v e r t d e c im a l n u m b e r s t o b in a r y , o c t a l,
a n d h e x n u m b e r s . Y o u w ill a ls o h a v e t o b e a b le t o c o n v e r t b in a r y , o c t a l,
a n d h e x n u m b e r s t o d e c im a l n u m b e r s . C o n v e r t in g e a c h n u m b e r s y s t e m
to ea ch of th e oth ers w ill be e x p la in e d . T h is w ill prepa re you fo r
c o n v e r t in g fr o m a n y b a se to a n y oth er b a se w h en n eeded.

1 . D E C IM A L C O N V E R S IO N

S om e com p u ter sy stem s h a ve th e c a p a b ilit y to con vert


d e c im a l n u m bers to b in a r y n u m bers. Th ey do t h is by u s in g
a d d it io n a l c ir c u it r y . M a n y of th ese sy stem s r e q u ir e th a t th e
d e c im a l n u m b e r s b e c o n v e r t e d t o a n o t h e r fo r m b e fo r e e n t r y .

F lo r e n c e M . B a n a s ih a n Page 16
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

a . D e c im a l t o B in a r y

C o n v e r s io n of a d e c im a l n u m ber to a n y oth er ba se is
a c c o m p lis h e d b y d iv id in g t h e d e c im a l n u m b e r b y t h e r a d ix o f t h e
sy stem you a re c o n v e r t in g to. T h e fo llo w in g d e fin it io n s id e n t ify
t h e b a s ic t e r m s u s e d in d iv is io n :

 D IV ID E N D - T h e n u m b e r t o b e d iv id e d

 D IV IS O R - T h e n u m b e r b y w h ic h a d iv id e n d is d iv id e d
 Q U O T IE N T - Th e n u m ber r e s u lt in g fr o m th e d iv is io n of on e
n u m b er b y a n o th er R E M A IN D E R – Th e fin a l u n d iv id e d
p a r t a ft e r d iv is io n t h a t is le s s or of a lo w e r degree th a n th e
d iv is o r .

T o c o n v e r t a b a s e 1 0 w h o le n u m b e r t o it s b in a r y e q u iv a le n t ,
fir s t s e t u p t h e p r o b le m fo r d iv is io n :

S te p 1 - D iv id e t h e b a s e 1 0 n u m b e r b y t h e r a d ix (2 ) o f t h e b in a r y
sy stem a n d extra ct th e r e m a in d e r (t h is becom es th e b in a r y
n u m b e r 's L S D ) .

S te p 2 - C o n t in u e t h e d iv is io n b y d iv id in g t h e q u o t ie n t o f s t e p 1

b y t h e r a d ix (2 / 2 ).

S te p 3 - C o n t in u e d iv id in g q u o t ie n t s by th e r a d ix u n t il th e
q u o t ie n t becom es s m a lle r th a t th e d iv is o r ; th en do on e m ore
d iv is io n . T h e r e m a in d e r is o u r M S D .

F lo r e n c e M . B a n a s ih a n Page 17
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

Th e r e m a in d e r in step 1 is ou r LS D . N ow r e w r it e th e
s o lu t io n , a n d you w ill s e e th a t 5 10 e q u a ls 1 0 1 2. N ow fo llo w th e
c o n v e r s io n of 23 10 t o b in a r y :

S te p 1 - S e t u p t h e p r o b le m fo r d iv is io n :

S te p 2 - D iv id e t h e n u m b e r a n d e x t r a c t t h e r e m a in d e r :

F lo r e n c e M . B a n a s ih a n Page 18
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

S t e p 3 - R e w r it e t h e s o lu t io n fr o m M S D to L S D :

10111 2

N o m a tter h ow la r g e t h e d e c im a l n u m b e r m a y be, w e u se
th e sa m e p roced u re. L e t 's t r y t h e p r o b l e m b e lo w . It h a s a la r g er
d iv id e n d :

F lo r e n c e M . B a n a s ih a n Page 19
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

W e ca n c o n v e r t fr a c t io n a l d e c im a l n u m b e r s b y m u lt ip ly in g
t h e fr a c t io n b y t h e r a d ix a n d e x t r a c t in g t h e p o r t io n o f t h e p r o d u c t
t o t h e le ft o f t h e r a d ix p o in t . C o n t in u e t o m u lt ip ly t h e fr a c t io n a l
p o r t io n of th e p r e v io u s produ ct u n t il th e d e s ir e d degree of
a c c u r a c y is a t t a in e d .

L e t 's go th rou g h t h is process a n d con vert 0 .2 5 10 to it s


b in a r y e q u iv a le n t :

T h e f ir s t fig u r e t o t h e le ft o f t h e r a d ix p o in t is t h e M S D , a n d
t h e la s t fig u r e o f t h e c o m p u t a t i o n is t h e L S D . R e w r it e t h e s o lu t io n
fr o m M S D to L S D preceded b y t h e r a d ix p o in t a s s h o w n :

.0 1 2

N ow t r y c o n v e r t in g .6 2 5 10 t o b in a r y :

A s w e m e n t io n e d b e fo r e , you s h o u ld c o n t in u e th e
o p e r a t io n s u n t il y o u rea ch th e d e s ir e d a ccu ra cy. F or e x a m p le ,
c o n v e r t .4 2 5 10 t o fiv e p la c e s in t h e b in a r y s y s t e m :

F lo r e n c e M . B a n a s ih a n Page 20
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

A lt h o u g h th e m u lt ip lic a t io n w a s c a r r ie d ou t fo r seven
p la c e s , you w o u ld o n ly u se w h a t is r e q u ir e d . W r it e ou t th e
s o lu t io n a s sh ow n :

0 .0 1 1 0 1 2

To con vert a m ix e d n u m ber su ch a s 3 7 .6 2 5 10 to b in a r y ,


s p lit th e n u m b e r in t o it s w h o le a n d fr a c t io n a l c o m p o n e n t s a n d
s o lv e ea ch on e s e p a r a t e ly . In t h is p r o b le m ca rry th e fr a c t io n a l
p a rt to fo u r p la c e s . W h en th e c o n v e r s io n of ea ch is c o m p le t e d ,
r e c o m b in e it w it h t h e r a d ix p o in t a s s h o w n b e lo w :

P R O B L E M S E T N U M B E R 2 (Q 4 8 - 5 3 )

C o n v e r t t h e fo llo w in g d e c im a l n u m b e r s t o b in a r y :

1. 48 72 10

2. 97 10 .

3. 243 10 .

4. 0 .8 7 5 10 (fo u r p la c e s ).

5. 0 .3 3 10 (fo u r p la c e s ).

6. 1 7 .4 2 10 (fiv e p la c e s ).

F lo r e n c e M . B a n a s ih a n Page 21
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

b . D e c im a l t o O c t a l

T h e c o n v e r s io n o f a d e c im a l n u m b e r t o it s b a s e 8 e q u iv a le n t
is don e by th e rep ea ted d iv is io n m eth od . Y ou s im p ly d iv id e th e
ba se 10 n u m ber by 8 a n d extra ct th e r e m a in d e r s . Th e fir s t
r e m a in d e r w ill b e th e LS D , a n d th e la s t r e m a in d e r w ill be th e
M S D .

L o o k a t t h e fo llo w in g e x a m p le . T o c o n v e r t 1 5 10 t o o c t a l, s e t
u p t h e p r o b le m fo r d iv is io n :

S in c e 8 g o e s in t o 1 5 o n e t im e w it h a 7 r e m a in d e r , 7 t h e n is
th e LS D . N ext d iv id e 8 in t o th e q u o t ie n t (1 ). Th e r e s u lt is a 0
q u o t ie n t w it h a 1 r e m a in d e r . T h e 1 is t h e M S D :

N ow w r it e o u t t h e n u m b e r fr o m M S D to L S D a s sh ow n :

17 8

Th e sa m e process is u sed r e g a r d le s s of th e s iz e of th e
d e c im a l n u m b e r . N a t u r a lly , m o r e d iv is io n s a re n eeded fo r la r g er
n u m b e r s , a s in t h e fo llo w in g e x a m p le :

C on vert 264 10 t o o c t a l:

F lo r e n c e M . B a n a s ih a n Page 22
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

B y r e w r it in g t h e s o lu t io n , y o u fin d t h a t t h e o c t a l e q u iv a le n t
of 264 10 is a s fo llo w s :

410 8

T o c o n v e r t a d e c im a l fr a c t io n t o o c t a l, m u lt ip ly t h e fr a c t io n
b y 8 . E x t r a c t e v e r y t h in g t h a t a p p e a r s t o t h e le ft o f t h e r a d ix p o in t .
Th e fir s t n u m b er extra cted w ill b e th e M S D a n d w ill fo llo w th e

r a d ix p o in t . T h e la s t n u m b e r e x t r a c t e d w ill b e t h e L S D .

C o n v e r t 0 .0 5 10 t o o c t a l:

W r it e t h e s o lu t io n fr o m M S D to L S D :

.0 3 1 4 6 8

Y ou ca n ca rry th e c o n v e r s io n ou t to a s m a n y p la c e s a s
n e e d e d , b u t u s u a lly fo u r o r fiv e p la c e s a r e e n o u g h .

T o c o n v e r t a m ix e d d e c im a l n u m b e r t o it s o c t a l e q u iv a le n t ,
s p lit t h e n u m b e r in t o w h o le a n d fr a c t io n a l p o r t io n s a n d s o lv e a s
sh ow n b e lo w :

C o n v e r t 1 0 5 .5 8 9 10 t o o c t a l:

F lo r e n c e M . B a n a s ih a n Page 23
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

C o m b in e t h e p o r t io n s in t o a m ix e d n u m b e r :

1 5 1 .4 5 5 4 8

P R O B L E M S E T N U M B E R 3 (Q 5 4 - 5 9 )

C o n v e r t t h e fo llo w in g d e c im a l n u m b e r s t o o c t a l:

1. 7 10

2. 43 10

3. 499 10

4. 0 .9 5 1 10 (fo u r p la c e s )

5. 0 .0 0 4 10 (fiv e p la c e s )

6. 2 5 2 .1 7 10 (t h r e e p la c e s ).

c . D e c im a l t o H e x

To con vert a d e c im a l n u m ber to ba se 16, fo llo w th e


rep ea ted d iv is io n procedu res you u sed to con vert to b in a r y a n d
o c t a l , o n l y d i v i d e b y 1 6 . L e t 's l o o k a t a n e x a m p le :

F lo r e n c e M . B a n a s ih a n Page 24
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

C on vert 63 10 to h ex:

T h e r e fo r e , t h e h e x e q u iv a le n t o f 6 3 10 is 3 F 16 .

Y o u h a v e t o r e m e m b e r t h a t t h e r e m a in d e r is in b a s e 1 0 a n d
m u st be con verted to h ex if it exceeds 9. L e t 's w ork th rou gh

a n o t h e r e x a m p le :

C on vert 174 10 to h ex:

W r it e t h e s o lu t io n fr o m M S D to L S D :

A E 16

T h e r e w ill p r o b a b ly b e v e r y fe w t im e s w h e n y o u w ill h a v e t o
c o n v e r t a d e c im a l fr a c t io n t o a h e x fr a c t io n . I f t h e o c c a s io n s h o u ld
a r is e , t h e c o n v e r s io n is don e in th e sa m e m a n n er a s b in a r y or
o c t a l. U s e t h e fo llo w in g e x a m p le a s a p a t t e r n :

F lo r e n c e M . B a n a s ih a n Page 25
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

C o n v e r t 0 .6 9 5 10 to h ex:

T h e s o lu t io n : .B 1 E B 16

S h o u ld you h a ve th e n eed to con vert a d e c im a l m ix e d


n u m ber to h ex, con vert th e w h o le n u m ber a n d th e fr a c t io n

s e p a r a t e ly ; t h e n r e c o m b in e fo r t h e s o lu t io n .

P R O B L E M S E T N U M B E R 4 (Q 6 0 - 6 4 )

C o n v e r t t h e fo llo w in g d e c im a l n u m b e r s t o h e x :

1. 42 10

2. 83 10

3. 176 10

4. 491 10

5. 0 .7 2 1 10 (fo u r p la c e s ).

2 . B IN A R Y C O N V E R S IO N

E a r lie r in t h is c h a p t e r , w e m e n t io n e d t h a t t h e o c t a l a n d h e x
n u m b e r s y s t e m s a r e u s e fu l t o c o m p u t e r p r o g r a m m e r s . I t is m u c h
e a s ie r t o p r o v id e d a ta to a c o m p u t e r in on e or th e oth er of th ese
s y s t e m s . L ik e w is e , it is im p o r t a n t t o b e a b le t o c o n v e r t d a t a fr o m

F lo r e n c e M . B a n a s ih a n Page 26
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

th e com p u ter in t o on e or th e oth er n u m b er sy stem s fo r e a s e of


u n d e r s t a n d in g t h e d a t a .

a . B in a r y t o O c ta l

L o o k a t t h e fo llo w in g n u m b e r s :

Y o u c a n e a s ily s e e t h a t t h e o c t a l n u m b e r is m u c h e a s ie r t o
s a y . A lt h o u g h t h e t w o n u m b e r s lo o k c o m p le t e ly d iffe r e n t , t h e y a r e

e q u a l.

3
S in c e 8 is eq u a l to 2 , th en on e o c t a l d ig it ca n represen t
t h r e e b in a r y d ig it s , a s s h o w n b e lo w :

W it h th e u se o f t h is p r in c ip le , t h e c o n v e r s io n of a b in a r y
n u m b e r is q u it e s im p le . A s a n e x a m p le , fo llo w t h e c o n v e r s io n of
t h e b in a r y n u m b e r a t t h e b e g in n in g o f t h is s e c t io n .

W r it e o u t t h e b in a r y n u m ber to be con verted . S t a r t in g a t


th e r a d ix p o in t a n d m o v in g le ft , brea k th e b in a r y n u m ber in t o
g r o u p s o f t h r e e a s s h o w n . T h is g r o u p in g o f b in a r y n u m b e r s in t o
g r o u p s o f t h r e e is c a lle d b in a r y - c o d e d o c t a l (B C O ). A d d 0 s t o t h e
le ft o f a n y M S D t h a t w ill fill a g r o u p o f t h r e e :

N e x t , w r it e d o w n t h e o c t a l e q u iv a le n t o f e a c h grou p:

F lo r e n c e M . B a n a s ih a n Page 27
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

T o c o n v e r t a b in a r y fr a c t io n t o it s o c t a l e q u iv a le n t , s t a r t in g
a t th e r a d ix p o in t a n d m o v in g r ig h t , expa n d ea ch d ig it in t o a
g rou p of th ree:

A d d 0 s t o t h e r ig h t o f t h e L S D if n e c e s s a r y t o fo r m a grou p
of th ree. N ow w r it e th e octa l d ig it fo r ea ch grou p of th ree, a s
sh ow n b e lo w :

To con vert a m ix e d b in a r y n u m ber, s t a r t in g a t th e r a d ix


p o in t , fo r m g rou p s of th ree b oth r ig h t a n d le ft :

P R O B L E M S E T N U M B E R 5 (Q 6 5 - 7 0 )

C o n v e r t t h e fo llo w in g b in a r y n u m b e r s t o o c t a l:

1. 10 2

2. 1010 2

3. 101111 2

4. 0 .0 0 1 1 2

5. 0 .1 1 0 0 1 1 2

6. 1 1 0 1 1 1 .0 1 0 1 0 1 2 .

F lo r e n c e M . B a n a s ih a n Page 28
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

b . B in a r y t o H e x

T h e t a b le b e lo w s h o w s t h e r e la t io n s h ip b e t w e e n b in a r y a n d
h ex n u m bers. Y ou ca n see th a t fo u r b in a r y d ig it s m a y be
4
rep resen ted by on e h ex d ig it . T h is is b e c a u s e 1 6 is e q u a l t o 2 .

U s in g t h is r e la t io n s h ip , you ca n e a s ily con vert b in a r y


n u m bers to h ex. S t a r t in g a t th e r a d ix p o in t a n d m o v in g e it h e r
r ig h t o r le ft , b r e a k t h e n u m b e r in t o g r o u p s o f fo u r . T h e g r o u p in g
o f b in a r y in t o fo u r b it g r o u p s is c a lle d b in a r y - c o d e d h e x a d e c im a l
(B C H ).

C on vert 111010011 2 to h ex:

A dd 0s to th e le ft o f th e M S D of t h e w h o le p o r t io n of th e
n u m b e r a n d t o t h e r ig h t o f t h e L S D o f t h e fr a c t io n a l p a r t t o fo r m
a g r o u p o f fo u r .

C o n v e r t .1 1 1 2 to h ex:

In t h is ca se, if a 0 h a d n ot been a dded, th e c o n v e r s io n


w o u ld h a v e b e e n .7 16 , w h ic h is in c o r r e c t .

F lo r e n c e M . B a n a s ih a n Page 29
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

P R O B L E M S E T N U M B E R 6 (Q 7 1 - 7 6 )

C o n v e r t t h e fo llo w in g b in a r y n u m b e r s t o h e x :

1. 10 2

2. 1011 2

3. 101111 2

4. 0 .0 0 1 1 2

5. 0 .1 1 0 0 1 1 2

6. 1 1 0 1 1 1 .0 1 0 1 0 1 2 .

3 . O C T A L C O N V E R S IO N

Th e c o n v e r s io n of on e n u m ber sy stem to a n oth er, a s w e


e x p la in e d e a r lie r , is d o n e to s im p lify com p u ter progra m m in g or
in t e r p r e t in g o f d a t a .

a . O c ta l to B in a r y

F or som e com p u ters to a ccept octa l d a ta , th e o c t a l d ig it s


m u s t b e c o n v e r t e d t o b in a r y . T h is p r o c e s s is t h e r e v e r s e o f b in a r y
t o o c t a l c o n v e r s io n .

To con vert a g iv e n octa l n u m b er to b in a r y , w r it e o u t th e


o c t a l n u m b e r in t h e fo llo w in g fo r m a t . W e w ill c o n v e r t o c t a l 5 6 7 8 :

N e x t , b e lo w ea ch o c t a l d ig it w r it e t h e c o r r e s p o n d in g th ree -
d ig it b in a r y - c o d e d o c t a l e q u iv a le n t :

S o lu t io n : 5 6 7 8 e q u a ls 1 0 1 1 1 0 111 2

F lo r e n c e M . B a n a s ih a n Page 30
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

R e m o v e t h e c o n v e r s io n fr o m t h e fo r m a t :

101110111 2

A s y o u g a in e x p e r ie n c e , it m a y n o t b e n e c e s s a r y to u se th e
b lo c k fo r m a t .

A n o c t a l fr a c t io n (.1 2 3 8 ) is c o n v e r t e d in th e sa m e m a n n er,
a s sh ow n b e lo w :

S o lu t io n : .1 2 3 8 e q u a ls .0 0 1 0 1 0 0 1 1 2

A p p ly t h e s e p r in c ip le s t o c o n v e r t m ix e d n u m b e r s a s w e ll.

C o n v e r t 3 2 .2 5 8 t o b in a r y :

S o lu t io n : 3 2 .2 5 8 e q u a ls 0 1 1 0 1 0 .0 1 0 1 0 1 2

P R O B L E M S E T N U M B E R 7 (Q 7 7 - 8 2 )

C o n v e r t t h e fo llo w in g n u m b e r s t o b in a r y :

1. 73 8

2. 512 8

3. 403 8

4. 0 .4 5 6 8

5. 0 .7 3 8

6. 3 6 .5 8 .

F lo r e n c e M . B a n a s ih a n Page 31
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

b. O c ta l to H e x

Y o u w ill p r o b a b ly n o t r u n in t o m a n y o c c a s io n s t h a t c a ll fo r
t h e c o n v e r s io n of octa l n u m b ers to h e x . S h o u ld th e n eed a r is e ,
c o n v e r s io n is a t w o - s t e p p r o c e d u r e . C o n v e r t t h e o c t a l n u m b e r t o
b in a r y ; th en con vert th e b in a r y n u m ber to h ex. Th e step s to
c o n v e r t 5 3 .7 8 to h ex a re sh ow n b e lo w :

R e g r o u p t h e b in a r y d ig it s in t o g r o u p s o f fo u r a n d a d d z e r o s
w h e r e n e e d e d t o c o m p le t e g r o u p s ; t h e n c o n v e r t t h e b in a r y t o h e x .

S o lu t io n : 5 3 .7 8 e q u a ls 2 B .E 16

P R O B L E M S E T N U M B E R 8 (Q 8 3 - 8 6 )

C o n v e r t t h e fo llo w in g n u m b e r s t o h e x :

1. 74 8

2. 512 8

3. 0 .0 3 8

4. 1 4 .4 2 8 .

4 . H E X C O N V E R S IO N

Th e procedu res fo r c o n v e r t in g h ex n u m b e r s t o b in a r y a n d
o c t a l a r e t h e r e v e r s e o f t h e b in a r y a n d o c t a l c o n v e r s io n s to h ex.

a . H e x t o B in a r y

To con vert a h ex n u m b e r t o b in a r y , s e t u p t h e n u m b e r in
t h e b lo c k fo r m a t y o u u s e d in e a r lie r c o n v e r s io n s . B e lo w ea ch h ex
d ig it , w r it e t h e fo u r - d ig it b in a r y e q u iv a le n t . O b s e r v e t h e fo llo w in g
e x a m p le :

F lo r e n c e M . B a n a s ih a n Page 32
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

C on vert A B C 16 t o b in a r y :

S o lu t io n : A B C 16 = 101010111100 2

b. H e x to O c ta l

J u s t lik e t h e c o n v e r s io n of octa l to h e x , c o n v e r s io n of h ex
t o o c t a l is a t w o - s t e p p r o c e d u r e . F ir s t , c o n v e r t t h e h e x n u m b e r t o
b i n a r y ; a n d s e c o n d , c o n v e r t t h e b i n a r y n u m b e r t o o c t a l . L e t 's u s e

t h e s a m e e x a m p le w e u s e d a b o v e in t h e h e x t o b in a r y c o n v e r s io n
a n d c o n v e r t it t o o c t a l:

P R O B L E M S E T 9 (Q 8 7 - 9 0 )

C on vert th ese ba se 16 n u m bers to t h e ir e q u iv a le n t b a s e 2 a n d

ba se 8 n u m b ers:

1. 23 16

2. 1B 16

3. 0 .E 4 16

4. A 16

5 . C O N V E R S IO N T O D E C IM A L

C o m p u t e r d a t a w ill h a v e lit t le m e a n in g t o y o u if y o u a r e n o t
fa m ilia r w it h t h e v a r io u s n u m b e r s y s t e m s . It is o ft e n n ecessa ry
to con vert th ose b in a r y , o c t a l, or h ex n u m bers to d e c im a l
n u m bers. Th e n eed fo r u n d e r s t a n d in g is b etter illu s t r a t e d by
s h o w in g y o u a p a y c h e c k p r in t e d in b in a r y . A c h e c k in t h e a m o u n t

F lo r e n c e M . B a n a s ih a n Page 33
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

o f $ 1 0 ,0 1 0 ,1 0 1 .0 0 2 lo o k s im p r e s s iv e b u t in r e a lit y o n ly a m o u n ts
t o $ 1 4 9 .0 0 10 .

a . B in a r y t o D e c im a l

Th e com p u ter t h a t c a lc u la t e s y o u r p a y p r o b a b ly op e ra tes


w it h b in a r y n u m bers, so a c o n v e r s io n ta k es p la c e in th e
com p u ter b e fo r e th e a m ou n t is p r in t e d on you r ch eck. S om e

c o m p u t e r s , h o w e v e r , d o n 't a u t o m a t ic a lly c o n v e r t fr o m b in a r y t o
d e c im a l. Th ere m a y be t im e s w h en you m u st con vert
m a t h e m a t ic a lly .

T o con vert a b a se 2 n u m b er to b a se 1 0 , y ou m u st k n ow th e
d e c im a l e q u iv a le n t of ea ch pow er of 2. Th e d e c im a l v a lu e of a
pow er of 2 is o b t a in e d by m u lt ip ly in g 2 by it s e lf t h e n u m ber of
t im e s in d ic a t e d b y t h e e x p o n e n t fo r w h o le n u m b e r s ; fo r e x a m p le ,
4
2 = 2 X 2 X 2 X 2 or 16 10 .

F or fr a c t io n a l n u m bers, th e d e c im a l v a lu e is eq u a l to 1
d iv id e d b y 2 m u lt ip lie d b y it s e lf t h e n u m b e r o f t im e s in d ic a t e d b y
t h e e x p o n e n t . L o o k a t t h is e x a m p le :

Th e t a b le b e lo w sh ow s a p o r t io n of th e p o s it io n s a n d
d e c im a l v a lu e s o f t h e b in a r y s y s t e m :

R em em ber, e a r lie r in t h is ch a p ter you le a r n e d th a t a n y


n u m b e r t o t h e 0 p o w e r is e q u a l t o 1 10 .

A n oth er m eth od of d e t e r m in in g th e d e c im a l v a lu e of a
p o s it io n is t o m u lt ip ly t h e p r e c e d in g v a lu e b y 2 fo r w h o le n u m b e r s
a n d t o d iv id e t h e p r e c e d in g v a lu e b y 2 fo r fr a c t io n a l n u m b e r s , a s
sh ow n b e lo w :

F lo r e n c e M . B a n a s ih a n Page 34
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

L e t 's con vert a b in a r y n u m ber to d e c im a l by u s in g th e


p o s it io n a l n o t a t io n m eth od . F ir s t , w r it e ou t th e n u m ber to be
c o n v e r t e d ; t h e n , w r it e in t h e d e c im a l e q u iv a le n t fo r e a c h p o s it io n
w it h a 1 in d ic a t e d . A dd th ese v a lu e s to d e t e r m in e th e d e c im a l
e q u iv a le n t o f t h e b in a r y n u m b e r . L o o k a t o u r e x a m p le :

Y ou m a y w a n t to w r it e th e d e c im a l e q u iv a le n t fo r ea ch
p o s it io n a s w e d id in t h e fo llo w in g e x a m p le . A d d o n ly t h e v a lu e s
in d ic a t e d b y a 1 .

P R O B L E M S E T 1 0 (Q 9 1 - 9 6 )

Y ou s h o u ld m a ke su re th a t th e d e c im a l v a lu e s fo r ea ch

p o s it io n a re p r o p e r ly a lig n e d b e fo r e a d d in g . F or p r a c t ic e l e t 's

c o n v e r t t h e s e b in a r y n u m b e r s t o d e c im a l:

1. 10010 2

2. 1111100 2

3. 1010101 2

4. 0 .0 1 0 1 2

5. 0 .1 0 1 0 2

6. 1 1 0 1 1 0 1 .1 1 1 1 2 .

F lo r e n c e M . B a n a s ih a n Page 35
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

b . O c t a l t o D e c im a l

C o n v e r s io n o f o c t a l n u m b e r s t o d e c im a l is b e s t d o n e b y t h e
p o s it io n a l n o t a t io n m eth od . T h is process is t h e on e w e u sed to
c o n v e r t b in a r y n u m b e r s t o d e c im a l.

F ir s t , d e t e r m in e t h e d e c im a l e q u iv a le n t fo r e a c h p o s it io n b y
m u lt ip ly in g 8 by it s e lf th e n u m ber of t im e s in d ic a t e d by th e

exp on en t. S et u p a ba r gra ph of th e p o s it io n s a n d v a lu e s a s
sh ow n b e lo w :

To con vert a n octa l n u m ber to d e c im a l, w r it e ou t th e


n u m ber to be con verted , p la c in g ea ch d ig it u n der th e proper
p o s it io n .

E x a m p le :

N e x t , m u lt ip ly t h e d e c im a l e q u iv a le n t b y t h e c o r r e s p o n d in g
d ig it o f t h e o c t a l n u m b e r ; t h e n , a d d t h is c o lu m n o f fig u r e s fo r t h e
fin a l s o lu t io n :

S o lu t io n : 7 4 3 8 is e q u a l t o 4 8 3 10

N ow fo llo w t h e c o n v e r s io n of 26525 8 t o d e c im a l:

F lo r e n c e M . B a n a s ih a n Page 36
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

S o lu t io n : 1 1 ,6 0 5 10 is t h e d e c im a l e q u iv a le n t o f 2 6 ,5 2 5 8

To con vert a fr a c t io n or a m ix e d n u m b e r , s im p ly u se th e

sa m e procedu re.

E x a m p le : C h a n g e .5 8 t o d e c im a l:

E x a m p le : C o n v e r t 2 4 .3 6 8 t o d e c im a l:

S o lu t io n : 2 4 .3 6 8 e q u a ls 2 0 .4 6 8 7 5 10

I f y o u r p r e fe r o r fin d it e a s ie r , y o u m a y w a n t t o c o n v e r t t h e
o c t a l n u m b e r t o b in a r y a n d t h e n t o d e c im a l.

F lo r e n c e M . B a n a s ih a n Page 37
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

P R O B L E M S E T 1 1 (9 7 - 1 0 2 )

C o n v e r t t h e fo llo w in g n u m b e r s t o d e c im a l:

1. 17 8

2. 64 8

3. 375 8

4. 0 .4 8

5. 0 .6 1 8

6. 1 0 .2 2 8 .

c . H e x t o D e c im a l

It is d iffic u lt to com preh en d th e m a g n it u d e of a ba se 16


n u m b e r u n t il it is p r e s e n t e d in b a s e 1 0 ; fo r in s t a n c e , E 0 16 is e q u a l

to 224 10 . Y ou m u st rem em ber th a t u s u a lly fe w e r d ig it s a re


n ecessa ry t o r e p r e s e n t a d e c im a l v a lu e in ba se 16.

W h en you con vert fr o m ba se 16 to d e c im a l, y o u m a y u se


t h e p o s it io n a l n o t a t io n s y s t e m fo r t h e p o w e r s o f 1 6 (a b a r g r a p h ).
Y ou ca n a ls o con vert th e ba se 16 n u m ber to b in a r y a n d th en
con vert to b a se 1 0 .

N o t e in th e b a r g ra p h b e lo w th a t ea ch pow er of 16 r e s u lt s
in a trem en d ou s in c r e a s e in th e d e c im a l e q u iv a le n t . O n ly on e
-1
n e g a t iv e p o w e r (1 6 ) is s h o w n fo r d e m o n s t r a t io n pu rposes:

Ju st a s you d id w it h o c t a l c o n v e r s io n , w r it e o u t th e h ex
n u m b e r , p la c in g ea ch d ig it u n d e r t h e a p p r o p r ia t e d e c im a l v a lu e
fo r t h a t p o s it io n . M u lt ip ly t h e d e c im a l v a lu e b y t h e b a s e 1 6 d ig it

a n d a dd th e v a lu e s . (C o n v e r t A th rou g h F to t h e ir d e c im a l
e q u i v a l e n t b e f o r e m u l t i p l y i n g ) . L e t 's t a k e a l o o k a t a n e x a m p le .

F lo r e n c e M . B a n a s ih a n Page 38
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

C on vert 2C 16 t o d e c im a l:

T h e d e c im a l e q u iv a le n t o f 2 C 16 is 4 4 10 .

U se th e sa m e p roced u re w e u sed w it h b in a r y a n d octa l to


c o n v e r t b a s e 1 6 fr a c t io n s t o d e c im a l.

If y o u c h o o s e t o c o n v e r t t h e h e x n u m b e r t o b in a r y a n d t h e n
t o d e c im a l, t h e s o lu t io n w ill lo o k lik e t h is :

P R O B L E M S E T 1 2 (Q 1 0 3 - 1 0 6 )

C on vert th ese b a se 1 6 n u m b ers to b a se 1 0 :

1. 24 16

2. A 5 16

3. D B 16

4. 3 E 6 .5 16

F lo r e n c e M . B a n a s ih a n Page 39
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

E . O T H E R B IN A R Y C O D E S

A s d is c u s s e d p r e v io u s ly , it w a s s h o w n t h a t d ig it a l d a t a is r e p r e s e n t e d ,
s t o r e d a n d t r a n s m it t e d a s g r o u p s o f b in a r y d ig it s a ls o k n o w n a s b in a r y
c o d e , t h e r e a r e s o m e o t h e r p o p u la r c o d e d n u m b e r s t h a t w e r e w id e ly
u sed.

1 . B IN A R Y -C O D E D D E C IM A L
In t o d a y 's t e c h n o lo g y , you h ea r a grea t dea l a bou t
m ic r o p r o c e s s o r s . A m ic r o p r o c e s s o r is a n in t e g r a t e d c ir c u it
d e s ig n e d fo r t w o p u r p o s e s : d a t a p r o c e s s in g a n d c o n t r o l.

C om p u ters a n d m ic r o p r o c e s s o r s b oth op era te on a s e r ie s


o f e le c t r ic a l p u ls e s c a lle d w ord s. A w ord ca n b e rep resen ted by a
b in a r y n u m b e r s u c h a s 1 0 1 1 0 0 1 1 2. T h e w o r d le n g t h is d e s c r ib e d
by th e n u m ber of d ig it s or B IT S in th e s e r ie s . A s e r ie s of fo u r
d ig it s w o u ld be c a lle d a 4 - b it w ord a n d so fo r t h . Th e m ost
com m on a re 4 -, 8 -, a n d 1 6 - b it w ords. Q u it e o ft e n , t h e s e w ords
m u s t u s e b in a r y - c o d e d d e c im a l in p u t s .

B in a r y - c o d e d d e c im a l, o r B C D , is a m e t h o d o f u s in g b in a r y
d ig it s t o r e p r e s e n t t h e d e c im a l d ig it s 0 t h r o u g h 9 . A d e c im a l d ig it
is r e p r e s e n t e d b y fo u r b in a r y d ig it s , a s s h o w n b e lo w :

Y o u s h o u ld n o t e in t h e t a b le a b o v e t h a t t h e B C D c o d in g is
t h e b in a r y e q u iv a le n t o f t h e d e c im a l d ig it .

S in c e m a n y d e v ic e s u s e B C D , k n o w in g h o w t o h a n d le t h is

sy stem is im p o r t a n t . Y o u m u s t r e a liz e t h a t B C D a n d b in a r y a r e
n o t t h e s a m e . F o r e x a m p le , 4 9 10 in b in a r y is 1 1 0 0 0 1 2 , bu t 49 10 in
B C D is 0 1 0 0 1 0 0 1 B C D . E a c h d e c im a l d ig it is c o n v e r t e d t o it s b in a r y
e q u iv a le n t .

F lo r e n c e M . B a n a s ih a n Page 40
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

a . B C D C o n v e r s io n

Y ou ca n see by th e a b ove t a b le , c o n v e r s io n o f d e c im a l t o
B C D or B C D to d e c im a l is s im ila r to th e c o n v e r s io n of
h e x a d e c im a l t o b in a r y a n d v ic e v e r s a .

F or e x a m p le , l e t 's go th rou g h th e c o n v e r s io n of 264 10 to


B C D . W e 'l l u se th e b lo c k fo r m a t th a t you u sed in e a r lie r

c o n v e r s io n s . F ir s t , w r it e o u t t h e d e c im a l n u m b e r t o b e c o n v e r t e d ;
t h e n , b e lo w ea ch d ig it w r it e t h e B C D e q u iv a le n t o f t h a t d ig it :

Th e B C D e q u iv a le n t of 264 10 is 001001100100 B C D . To
con vert fr o m B C D to d e c im a l, s im p ly reverse th e process a s
sh ow n :

b. B C D A d d it io n

Th e procedu res fo llo w e d in a d d in g B C D a re th e sa m e a s


th ose u sed in b in a r y . Th ere is , h ow ever, th e p o s s ib ilit y th at
a d d it io n of B C D v a lu e s w ill r e s u lt in in v a lid t o t a ls . T h e fo llo w in g
e x a m p le s h o w s t h is :

A d d 9 a n d 6 in B C D :

Th e su m 1111 2 is t h e b in a r y e q u iv a le n t o f 1 5 10 ; h ow ever,
1111 is n ot a v a lid B C D n u m ber. Y ou ca n n ot exceed 1001 in

B C D , so a c o r r e c t io n fa c t o r m u s t b e m a de. To do t h is , y o u a dd
6 10 (0 1 1 0 B C D ) to th e su m of th e tw o n u m bers. Th e "a d d 6"
c o r r e c t io n fa c t o r is a d d e d to a n y B C D grou p la r g e r t h a n 1001 2 .

F lo r e n c e M . B a n a s ih a n Page 41
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

R em em ber, th ere is n o 1010 2 , 1011 2 , 1100 2 , 1101 2 , 1110 2 , or


1111 2 in B C D :

Th e su m p lu s th e a dd 6 c o r r e c t io n fa c t o r ca n th en be
con verted ba ck to d e c im a l t o c h e c k th e a n sw er . P u t a n y c a r r ie s
t h a t w e r e d e v e lo p e d in t h e a d d 6 p r o c e s s in t o a n e w 4 - b it w o r d :

N ow o b s e r v e t h e a d d it io n of 60 10 a n d 55 10 in B C D :

In t h is c a s e , t h e h ig h e r o r d e r g r o u p is in v a lid , b u t t h e lo w e r
o r d e r g r o u p is v a lid . T h e r e fo r e , t h e c o r r e c t io n fa c t o r is a d d e d o n ly
t o t h e h ig h e r o r d e r g r o u p a s s h o w n :

C o n v e r t t h is t o t a l t o d e c im a l t o c h e c k you r a n sw er:

R em em ber th a t th e c o r r e c t io n fa c t o r is a dded o n ly to
g rou p s th a t exceed 9 10 (1 0 0 1 B C D ).

F lo r e n c e M . B a n a s ih a n Page 42
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

P R O B L E M S E T 1 3 (Q 1 0 7 - 1 1 0 )

C o n v e r t t h e fo llo w in g n u m b e r s t o B C D a n d a dd:

1.

2.

3.

4.

2 . E X C E S S -O F -T H R E E C O D E

Th e E x cess-3 code is a ls o c a lle d a s X S -3 code. It is n on -


w e ig h t e d code u sed to express d e c im a l n u m b e r s . Th e E xcess -3
code w ords a re d e r iv e d fr o m th e 8421 B C D code w ords a d d in g
(0 0 1 1 )2 or (3 )1 0 to ea ch code w ord in 8421. F or e x a m p le , to
con vert 15 to a n ex cess -3 c o d e , fir s t 3 t o be a dded to ea ch d ig it
a s sh ow n b e lo w .

1 5

+ 3 + 3

4 8

T h is h a s t o b e c o n v e r t e d in B C D fo r m a s:

4 8

0100 1000

S o, 0100 1000 is th e E x c e s s - o f- t h r e e C ode sta n d fo r


d e c im a l 1 5 .

F lo r e n c e M . B a n a s ih a n Page 43
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

S u m m a r y o f t h e c o n v e r s io n o f d e c im a ls 0 t o 9 t o E x c e s s - 3 C odes
a r e a s fo llo w s :

T a b le 1 - 6 . E x a m p le s o f H o w E x c e s s - o f- t h r e e C o d e is p e r fo r m e d

E x a m p le :

1 . F in d t h e e x c e s s - 3 c o d e o f t h e d e c im a l n u m b e r o f

S o lu tio n :

T h e ex cess-3 c o d e fo r (2 3 7 )1 0 is o b t a in e d b y a d d in g 3 t o a ll
t h e d ig it s in d iv id u a lly , t h a t is 2 , 3 a n d 7 w ill b e c o m e 5 , 6 a n d 1 0
r e s p e c t iv e ly . T h e s e 5 , 6 a n d 1 0 d e c im a ls h a v e t o b e c o n v e r t e d in t o
b in a r y fo r m a n d t h e r e s u lt is 0 1 0 1 0 1 1 0 1 0 1 0 .

T h e ex cess-3 c o d e fo r (.7 5 )1 0 is o b t a in e d b y r e p la c in g 7 a n d

5 w it h 10 a n d 8 r e s p e c t iv e ly by a d d in g 3 to ea ch d ig it . T h a t is ,
th e ex cess-3 c o d e fo r (.7 5 ) ₁₀ is .1 0 1 0 1 0 0 0 .

C o m b in in g t h e r e s u lt s o f t h e in t e g r a l a n d fr a c t io n a l p a r t s ,
th e ex cess-3 c o d e fo r (2 3 7 .7 5 )₁₀ is 0 1 0 1 0 1 1 0 1 0 1 0 . 1 0 1 0 1 0 0 0 .

2 .F in d t h e d e c im a l n u m b e r o f e x c e s s - 3 n u m ber
1 1 0 0 1 0 1 0 0 0 1 1 .0 1 1 1 0 1 0 1

S o lu tio n :

B y s e p a r a t in g 4 b it s a s g r o u p t h e e q u iv a le n t e x c e s s - 3 code
is g iv e n a s 1100 1010 0 0 1 1 .0 1 1 1 0101

F lo r e n c e M . B a n a s ih a n Page 44
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

S u b t r a c t in g 0 0 1 1 fr o m ea ch fo u r - b it g r o u p , w e o b t a in th e
n ew n u m ber a s: 1001 0111 0 0 0 0 .0 1 0 0 0010.

T h e r e fo r e , t h e d e c im a l e q u iv a le n t is (9 7 0 .4 2 ) 1 0 .

3 . G R A Y C O D E

Th e gra y code is th e code w h ere on e b it w ill b e d iffe r e d to th e


p r e c e d in g n u m ber. F or e x a m p le , d e c im a l n u m bers 13 a n d 14 a re
rep resen ted by gra y code n u m bers 1011 a n d 10 01, th ese n u m bers
d iffe r o n ly in s in g le p o s it io n t h a t is t h e s e c o n d p o s it io n fr o m t h e r ig h t .
I n t h e s a m e w a y fir s t p o s it io n o n t h e le ft c h a n g e s fo r 7 a n d 8 w h ic h a r e
0 1 0 0 a n d 1 1 0 0 a n d t h is is a ls o c a lle d U n it - d is t a n c e c o d e . T h e g r a y c o d e
h a s v e r y s p e c ia l p la c e in d ig it a l e le c t r o n ic s .

R u les :

a . B in a ry to G ra y C o d e C o n v ers io n :

1. T h e M o s t S ig n ific a n t B it (M S B ) o f t h e g r a y c o d e is a lw a y s e q u a l t o
th e M S B o f t h e g iv e n b in a r y c o d e .
2. O th er b it s of th e ou tp u t g ra y cod e ca n be o b t a in e d by X O R in g

b in a r y c o d e b it a t t h a t in d e x a n d p r e v io u s in d e x .

E x a m p le :

C o n v e r t t h e b in a r y n u m b e r 1 1 1 0 1 in t o G r a y C o d e .

S o lu tio n :

F lo r e n c e M . B a n a s ih a n Page 45
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

M o re ex a m p le:

T a b le 1 - 7 . G r a y C o d e e q u iv a le n t o f t h e D e c im a l 0 - 1 5 .

D E C IM A L B IN A R Y G R A Y

N U M B E R C O D E C O D E

0 0000 0000

1 0001 0001

2 0010 0011

3 0011 0010

4 0100 0110

5 0101 0111

6 0110 0101

7 0111 0100

8 1000 1100

9 1001 1101

10 1010 1111

11 1011 1110

12 1100 1010

13 1101 1011

14 1110 1001

15 1111 1000

F lo r e n c e M . B a n a s ih a n Page 46
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

b .G r a y C o d e to B in a r y C o n v e r s io n :
1. T h e M o s t S ig n ific a n t B it (M S B ) o f t h e b in a r y c o d e is a lw a y s e q u a l
to th e M S B o f t h e g iv e n b in a r y n u m b e r .
2. O t h e r b it s o f t h e o u t p u t b in a r y c o d e c a n b e o b t a in e d b y c h e c k in g
g r a y c o d e b it a t t h a t in d e x . If c u r r e n t g r a y c o d e b it is 0 , t h e n c o p y
p r e v io u s b in a r y c o d e b it , e ls e c o p y in v e r t o f p r e v io u s b in a r y c o d e

b it .

E x a m p le :

C on vert th e G ra y C od e 1 0 1 0 in t o B in a r y N u m b e r .

S o lu tio n :

P R O B L E M S E T 1 4

1 - 1 6 . C o n v e r t t h e g iv e n G r e y C o d e o f D e c im a ls 0 - 1 5 (a s s h o w n
in T a b le 1 - 7 in t o it s e q u iv a le n t B in a r y N u m b e r . Y o u m u s t
sh ow y o u r S O L U T IO N S .

F lo r e n c e M . B a n a s ih a n Page 47
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

2. S U M M A R Y

N ow t h a t y o u 'v e c o m p l e t e d t h is c h a p t e r , y o u s h o u ld h a v e a b a s ic
u n d e r s t a n d in g o f n u m b e r s y s t e m s . T h e n u m b e r s y s t e m s t h a t w e r e d e a lt
w it h a re u sed e x t e n s iv e ly in th e m ic r o p r o c e s s o r a n d com p u ter fie ld s .
T h e fo llo w in g is a s u m m a r y o f t h e e m p h a s iz e d t e r m s a n d p o in t s fo u n d
in th e "N u m b er S y stem s" ch a p ter.

T h e U N IT rep resen ts a s in g le o b je c t .

A N U M B E R is a s y m b o l u s e d t o r e p r e s e n t o n e o r m o r e u n it s .

T h e R A D I X is t h e b a s e o f a p o s it io n a l n u m b e r s y s t e m . It is e q u a l t o t h e
n u m b e r o f s y m b o ls u s e d in th a t n u m b er sy stem .

A P O S I T I O N A L N O T A T I O N is a s y s t e m in w h ic h t h e v a lu e o r m a g n it u d e
of a n u m b e r is d e fin e d n o t o n ly by it s d ig it s o r s y m b o l v a lu e , b u t a ls o
b y it s p o s it io n . E a c h p o s it io n rep resen ts a p o w e r o f t h e r a d ix , o r b a s e ,
a n d is r a n k e d in a s c e n d in g o r d e s c e n d in g order.

Th e M O S T S IG N IF IC A N T D IG IT (M S D ) is a d ig it w it h in a n u m ber
(w h o le o r fr a c t io n a l) t h a t h a s t h e la r g e s t e ffe c t (w e ig h in g p o w e r ) o n t h a t
n u m ber.

Th e L E A S T S IG N IF IC A N T D IG IT (L S D ) is a d ig it w it h in a n u m ber

(w h o le o r fr a c t io n a l) t h a t h a s t h e le a s t e ffe c t (w e ig h t in g p o w e r ) o n th at
n u m ber.

F lo r e n c e M . B a n a s ih a n Page 48
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

T h e B IN A R Y N U M B E R S Y S T E M is a b a s e 2 s y s t e m . T h e s y m b o ls 1 a n d
0 ca n be u sed to represen t t h e s t a t e o f e le c t r ic a l/ e le c t r o n ic d e v ic e s . A
b in a r y 1 m a y in d ic a t e t h e d e v ic e is a c t iv e ; a 0 m a y in d ic a t e t h e d e v ic e
is in a c t iv e .

Th e O C T A L N U M B E R S Y S T E M is a ba se 8 sy stem a n d is q u it e u s e fu l
a s a tool in th e c o n v e r s io n of b in a r y n u m bers. T h is sy stem w orks
3
beca u se 8 is a n in t e g r a l p o w e r of 2 ; t h a t is , 2 = 8. Th e u se of octa l
n u m b e r s r e d u c e s t h e n u m b e r o f d ig it s r e q u ir e d t o r e p r e s e n t t h e b in a r y
e q u iv a le n t o f a d e c im a l n u m b e r .

Th e H E X N U M B E R S Y S T E M is a b a s e 1 6 s y s t e m a n d is s o m e t im e s u s e d
in com p u ter sy stem s. A b in a r y n u m ber ca n b e con verted d ir e c t ly to a
b a s e 1 6 n u m b e r if t h e b in a r y n u m b e r is fir s t b r o k e n in t o g r o u p s o f fo u r

d ig it s .

Th e b a s ic r u le s of A D D IT IO N a p p ly to ea ch of th e n u m ber sy stem s.
E a ch sy stem b e c o m e s u n iq u e w h e n c a r r ie s a r e p r o d u c e d .

S U B T R A C T I O N in e a c h s y s t e m is b a s e d o n c e r t a in r u le s o f t h a t n u m b e r
sy stem . Th e borrow v a r ie s in m a g n it u d e a c c o r d in g to th e n u m ber
sy stem in u se. In m ost com p u ters, s u b t r a c t io n is a c c o m p lis h e d by
u s i n g t h e c o m p l e m e n t ( R 's o r R 's - 1 ) o f t h e s u b t r a h e n d a n d a d d i n g i t t o
t h e m in u e n d .

To C O N V E R T A W H O L E B A S E 1 0 N U M B E R t o a n o t h e r s y s t e m , d iv id e
t h e d e c im a l n u m b e r b y t h e b a s e o f t h e n u m b e r s y s t e m t o w h ic h y o u a r e
c o n v e r t in g . C o n t in u e d iv id in g t h e q u o t ie n t o f t h e p r e v io u s d iv is io n u n t il
it c a n n o lo n g e r b e d o n e . E x t r a c t t h e r e m a in d e r s - t h e r e m a in d e r fr o m

t h e fir s t c o m p u t a t io n w ill y ie ld t h e L S D ; t h e la s t w ill p r o v id e t h e M S D .

F lo r e n c e M . B a n a s ih a n Page 49
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

T o C O N V E R T D E C I M A L F R A C T I O N S , m u lt ip ly t h e fr a c t io n b y t h e b a s e
o f t h e d e s ir e d n u m b e r s y s t e m . E x t r a c t t h o s e d ig it s t h a t m o v e t o t h e le ft
of th e r a d ix p o in t . C o n t in u e to m u lt ip ly th e fr a c t io n a l p r o d u c t fo r a s
m a n y p la c e s a s n e e d e d . T h e fir s t d ig it le ft o f t h e r a d ix p o in t w ill b e t h e
M S D , a n d t h e la s t w ill b e t h e L S D . T h e e x a m p le t o t h e r ig h t s h o w s t h e
p r o c e s s o f c o n v e r t in g 2 4 8 .3 2 10 t o t h e o c t a l e q u iv a le n t (3 7 0 .2 4 3 8 ).

B IN A R Y n u m bers a re con verted to O C T A L a n d H E X by t h e g r o u p in g


m eth od . Th ree b in a r y d ig it s eq u a l on e octa l d ig it ; fo u r b in a r y d ig it s
e q u a l o n e h e x d ig it .

To C O N V E R T b in a r y , o c t a l, a n d h ex n u m bers to D E C IM A L u se th e
P O W E R S o f t h e b a s e b e in g c o n v e r t e d .

F lo r e n c e M . B a n a s ih a n Page 50
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

B IN A R Y -C O D E D D E C IM A L (B C D ) is a c o d in g sy stem u sed w it h som e


m ic r o p r o c e s s o r s . A c o r r e c t io n fa c t o r is n eeded to correct in v a lid
n u m bers.

E X C E S S -O F -T H R E E C O D E s a re u n w e ig h t e d a n d ca n be o b t a in e d by
a d d in g 3 t o e a c h d e c im a l d ig it t h e n it c a n b e r e p r e s e n t e d b y u s in g 4 - b it
b in a r y n u m b e r fo r e a c h d ig it . A n E x cess-3 e q u iv a le n t o f a g iv e n b in a r y

b in a r y n u m b e r is o b t a in e d u s in g t h e fo llo w in g s t e p s :

 F in d t h e d e c im a l e q u iv a le n t o f t h e g iv e n b in a r y n u m b e r .

 A d d + 3 to ea ch d ig it o f d e c im a l n u m b e r .

 C o n v e r t t h e n e w ly o b t a in e d d e c im a l n u m b e r b a c k t o b in a r y n u m b e r
t o g e t r e q u ir e d e x c e s s - 3 e q u iv a le n t .

G R A Y C O D E is a n o r d e r in g o f t h e b in a r y n u m e r a l s y s t e m su ch th a t tw o

s u c c e s s iv e v a lu e s d iffe r in o n ly on e b it (b in a r y d ig it ). G r a y codes a re
v e r y u s e fu l in t h e n o r m a l s e q u e n c e o f b in a r y n u m b e r s g e n e r a t e d b y t h e
h a rd w a re th a t m a y ca u se a n e r r o r o r a m b ig u it y d u r in g t h e t r a n s it io n
fr o m on e n u m ber to th e n ext. S o, th e G ra y code ca n e lim in a t e t h is
p r o b le m e a s ily s in c e o n ly on e b it ch a n ges it s v a lu e d u r in g a n y
t r a n s it io n b e t w e e n tw o n u m b ers.

G r a y c o d e is n o t w e ig h t e d t h a t m e a n s it d o e s n o t d e p e n d on p o s it io n a l
v a lu e o f d ig it . T h is c y c lic v a r ia b le c o d e t h a t m e a n s e v e r y t r a n s it io n fr o m
o n e v a lu e t o t h e n e x t v a lu e in v o lv e s o n ly o n e - b it c h a n g e .

F lo r e n c e M . B a n a s ih a n Page 51
D C E E , C E IT

You might also like