# Number Systems and Number Systems and

(1)

Unit 01 2

## Unit 1Unit 1

(2)

Unit 01 3

zz

### Number Systems and ConversionNumber Systems and Conversion

1.1 Digital Systems and Switching Circuits1.1 Digital Systems and Switching Circuits

1.2 Number Systems and Conversion1.2 Number Systems and Conversion

1.3 Binary Arithmetic1.3 Binary Arithmetic

1.4 Representation of Negative Numbers1.4 Representation of Negative Numbers

1.5 Binary Codes1.5 Binary Codes

(3)

Unit 01 4

zz

### Digital system Digital system

The physical quantities or signals can The physical quantities or signals can assume only

assume only discretediscrete valuesvalues

Greater accuracyGreater accuracy zz

### Analog system Analog system

The physical quantities or signals may vary The physical quantities or signals may vary continuously

continuously over a specified rangeover a specified range

(4)

Unit 01 5

(5)

Unit 01 6

### Digital Systems and Switching CircuitsDigital Systems and Switching Circuits

zz Design of digital systemsDesign of digital systems

 System designSystem design

99Breaking the overall system into subsystemsBreaking the overall system into subsystems 99Specifying the characteristics of each subsystemSpecifying the characteristics of each subsystem

9 E.g. digital computer : 9E.g. digital computer : memory units, arithmetic unit, I/O memory units, arithmetic unit, I/O devices, control unit

devices, control unit

 Logic designLogic design

99Determining how to interconnect basic logic building blocks to Determining how to interconnect basic logic building blocks to perform a specific function

perform a specific function

9 E.g. arithmetic unit : binary addition: 9E.g. arithmetic unit : binary addition: logic gates, Fliplogic gates, Flip--Flops, Flops, interconnections

interconnections

 Circuit designCircuit design

99Specifying the interconnection of specific components such as Specifying the interconnection of specific components such as resistors, diodes, and transistors to form a gate, flip

resistors, diodes, and transistors to form a gate, flip--flop or other flop or other logic building block

logic building block

9 E.g. Flip9E.g. Flip--Flop: Flop: resistors, diodes, transistorsresistors, diodes, transistors

(6)

Unit 01 7

### Digital Systems and Switching CircuitsDigital Systems and Switching Circuits

zz Many of subsystems of a digital system take the Many of subsystems of a digital system take the form of a switching network

form of a switching network

 Switching NetworksSwitching Networks

99Combinational NetworksCombinational Networks

No memoryNo memory

99Sequential NetworksSequential Networks

Combinational Circuits + MemoryCombinational Circuits + Memory

(7)

Unit 01 8

zz

(8)

Unit 01 9

zz

### the radix or base of a number system.

where . where .0 ai R 1

(9)

Unit 01 10

### Example:

For bases greater than 10, more than 10 symbols are needed For bases greater than 10, more than 10 symbols are needed to represent the digits. In hexadecimal (base 16),

to represent the digits. In hexadecimal (base 16), AA presents presents 10101010, B, B presents 11presents 111010, C , C presents 12presents 121010, D, D presents 13presents 131010, E, E

presents 14

presents 141010, F, F presents 15presents 151010..

(10)

Unit 01 11

zz

nn..

2 3

3 1

4 4

1 2 3

1 2

2 1

3 3

1 1 2

0 1

1 1

2 2

1 1

remaider

,

remaider

,

remaider

,

a Q

a R

a R

a R

R a Q

a Q

a R

a R

a R

R a Q

a Q

a R

a R

a R

R a N

n n

n n

n n

n n

n n

n n

= +

+ +

+

=

= +

+ +

+

=

= +

+ +

+

=

L L L

(11)

Unit 01 12

### Number Systems and ConversionNumber Systems and Conversion

zz Example : Convert 53Example : Convert 531010 to binary.to binary.

(12)

Unit 01 13

zz

(13)

Unit 01 14

zz

1010

(14)

Unit 01 15

### Number Systems and ConversionNumber Systems and Conversion

zz Example: Convert 0.7Example: Convert 0.710 10 to binary.to binary.

(15)

Unit 01 16

### Number Systems and ConversionNumber Systems and Conversion

zz Example: Convert 231.3Example: Convert 231.344 to base 7.to base 7.

(16)

Unit 01 17

zz

### ( and conversely)

One hexadecimal digit corresponds to four One hexadecimal digit corresponds to four bibinary digitnary digits (bits (bits)s)

D D

6 0

3

) 1101 0110

0000 0011

( )

. 306

( 16 = 2

(17)

Unit 01 18

### Binary ArithmeticBinary Arithmetic

 Example: Add 13Example: Add 131010 and 11and 111010 in binary.in binary.

(18)

Unit 01 19

### Binary ArithmeticBinary Arithmetic

zz SubtractionSubtraction

 Examples:Examples:

(19)

Unit 01 20

zz

### Multiplication Multiplication

Example:Example:

(20)

Unit 01 21

zz

### Division Division

Example: 145/11=13 Example: 145/11=13 --- 22

(21)

Unit 01 22

zz

### 2 2 ’ ’ s Complement Number System s Complement Number System

Positive Number Positive Number N N

99 N N is represented by a 0 followed by the is represented by a 0 followed by the magnitude.

magnitude.

Negative Number Negative Number ––NN

99N N is represented by its 2is represented by its 2s complement, s complement, NN*. If the word length is n,*. If the word length is n,

NN*=2*=2nn--NN

(22)

Unit 01 23

### Representation of Negative NumbersRepresentation of Negative Numbers

zz 11’’s Complement Number Systems Complement Number System

 Positive Number Positive Number N N

99 N N is represented by a 0 followed by the is represented by a 0 followed by the magnitude

magnitude

 Negative Number Negative Number NN

9–9–N N is represented by its 1is represented by its 1s complement . s complement . If the word length is

If the word length is nn,,

N*=2N*=2nn-N-N=(2=(2nn--11--N)+1= +1N)+1= +1N

n

N

(23)

Unit 01 24

zz

### Sign and Magnitude Binary Numbers Sign and Magnitude Binary Numbers

(24)

Unit 01 25

 Any carry from the sign position is ignored.Any carry from the sign position is ignored.



 n=4n=4

(25)

Unit 01 26

).

( is result the

so

, 2 g subtractin to

equivalent is

carry last away the Throwing

carry) , (

2 ) (

2

) 2

(

n

*

A B

A B A

B

B A B

A B A

n n

n

>

+

=

+

= +

= +

(26)

Unit 01 27

).

( of tion representa correct

the is which

, ) (

) (

2 yields carry last the Discarding

carry) ,

2 (

2 ) (

2 2

) 2 ( ) 2 (

* 1

*

*

B A

B A B A B

A B

A

B A

B A B A

n n n

n n

n n

+

+

= +

+

+

+

=

+

= +

=

(27)

Unit 01 28

Example: Add --8 and +19 in 28 and +19 in 2’’s complements complement for a word length of n=8.

for a word length of n=8.

(28)

Unit 01 29

 Add the Add the last carrylast carry ( ( endend--around carryaround carry) to the n-) to the n- bit sum in the position furthest to the right.

bit sum in the position furthest to the right.

 n = 4

(29)

Unit 01 30

).

( is result the

so

2 g subtractin to

equivalent is

carry around

- end The

carry) , (

2 1 ) (

2

) 1 2 (

n

A B

A B A

B

B A B

A B A

n n

n

>

+

=

+

= +

= +

(30)

Unit 01 31

).

( of tion representa correct

the is which

, ) (

) (

1 2 yields carry last the Discarding

carry) ,

2 (

2 1 )]

( 1 2 [ 2

) 1 2 ( ) 1 2 (

1

B A

B A B

A B A B

A

B A

B A B A

n

n n

n n

n n

+

+

= +

<

+

+

+

=

+

= +

=

(31)

Unit 01 32

Example: Add --11 and -11 and -20 in 120 in 1’’s complement for s complement for a word length of n=8.

a word length of n=8.

(32)

Unit 01 33

### Binary CodesBinary Codes

zz Weighted codeWeighted code

ww33-w-w22-w-w11-w-w00 weighted code weighted code aa33aa22aa11aa00 aa33aa22aa11aa00= w= w33aa33+w+w22aa22+w+w11aa11+w+w00aa00

 Binary-Binary-Coded-Coded-Decimal, BCD; 8Decimal, BCD; 8--44--22--1BCD code1BCD code 0101=0

0101=0..8+18+1..4+04+0..2+12+1..1=51=5

 6-6-3-3-11--1 code1 code 0101=0

0101=0..6+16+1..3+03+0..1+11+1..1=41=4

zz Excess-Excess-3 code3 code

 8-8-4-4-22--1 code + 00111 code + 0011

 The code of iThe code of i is the 1’is the 1’s complement of code s complement of code 99--ii

z

z 2-2-outout--ofof--5 code5 code

 Exactly 2 out of 5 bits are 1Exactly 2 out of 5 bits are 1

 Error-Error-checking propertieschecking properties zz Gray codeGray code



 The codes for successive decimal digits differ in exactly on bit.The codes for successive decimal digits differ in exactly on bit. zz ASCII codeASCII code



 American American SStandard tandard CCode forode forIInformation Information Interchangenterchange

(33)

Unit 01 34

(34)

Unit 01 35

(35)

Unit 01 36

(36)

## Unit 2Unit 2

(37)

Unit 02 2

zz

### Boolean AlgebraBoolean Algebra

2.1 Introduction2.1 Introduction

2.2 Basic Operations2.2 Basic Operations

2.3 Boolean Expressions and Truth Tables2.3 Boolean Expressions and Truth Tables

2.4 Basic Theorems2.4 Basic Theorems

2.5 Commutative, Associative, and 2.5 Commutative, Associative, and Distributive Laws

Distributive Laws

2.6 Simplification Theorems2.6 Simplification Theorems

2.7 Multiplying Out and Factoring2.7 Multiplying Out and Factoring

2.8 2.8 DemorganDemorgan’’ss LawsLaws

(38)

Unit 02 3

### IntroductionIntroduction

zz George George BooleBoole developed Boolean algebra developed Boolean algebra in 1847 and used it to solve problems in in 1847 and used it to solve problems in

mathematical logic.

mathematical logic.

zz Boolean AlgebraBoolean Algebra

A Boolean algebraA Boolean algebra is an algebrais an algebra (B; . , + ,

(B; . , + ,’’ ;0, 1);0, 1) consisting of a set consisting of a set BB (which (which contains at least two elements

contains at least two elements 00 and and 11) ) together with

together with threethree operations,operations,

the the ANDAND (Boolean product(Boolean product) operation ) operation .. ,, the the OROR (Boolean sum(Boolean sum) operation ) operation ++, and, and

the the NOTNOT (complement(complement) operation ) operation ’’ , defined , defined on the set, such that

on the set, such that

(39)

Unit 02 4

### IntroductionIntroduction

 A0. ClosureA0. Closure: For any : For any x,yx,y, and z of B, , and z of B, xx..yy, , xx++yy, x, x are in Bare in B

 A1. IdempotentA1. Idempotent: : xx..xx=x =x x+xx+x=x=x

 A2. CommutativeA2. Commutative: : xx..yy==yy..xx xyxy==yxyx

 A3. AssociativeA3. Associative: :

xx.. ((yy..zz)=()=(xx..yy) ) ..z=x z=x .. y y .. z z xx++ ((yy++zz)=()=(xx++yy) ) ++z=x z=x ++ y y ++ zz

 A4. AbsorptiveA4. Absorptive: x : x .. (x (x ++ y)=x x y)=x x ++(x(x.. y)=xy)=x

 A5. DistributiveA5. Distributive::

x x .. (y (y ++ z)=(x z)=(x .. y) y) ++(x (x .. z)z) x x ++(y (y .. z)=(x z)=(x ++ y) y) .. (x (x ++ z)z)

 A6. ZeroA6. Zero( null, smallest), ( null, smallest), 00 , and One, and One( universal, largest), ( universal, largest), 11 , , elements are in B

elements are in B

x x .. 11==11 .. x=x x x=x x ++ 00==0 0 ++ x=xx=x

 A7. ComplementA7. Complement

For every x in B, there exists a unique x

For every x in B, there exists a unique x in B such thatin B such that x x .. xx==00, x , x ++ xx==11

(40)

Unit 02 5

### IntroductionIntroduction

zz Example:Example: TwoTwo--element Boolean Algebraelement Boolean Algebra (Switching Algebra)

(Switching Algebra) BB22=({0,1}; =({0,1}; . . ,+, ,+, ’’ ; 0,1); 0,1)

AND OR NOT AND OR NOT

11 00

11

00 00

00

11 00

..

11 11

11

11 00

00

11 00

++

00 11

11 00

’’

(41)

Unit 02 6

### IntroductionIntroduction

zz Example:Example: FourFour--element Boolean Algebraelement Boolean Algebra BB44=({0,a,b,1} ; =({0,a,b,1} ; . . ,+, ,+, ’’ ; 0,1) ; 0,1)

AND OR NOT AND OR NOT

11 bb aa 00 11

bb bb 00 00 bb

aa 00 aa 00 aa

00 00 00 00 00

11 bb aa 00 ..

11 11 11 11 11

11 bb 11 bb bb

11 11 aa aa aa

11 bb aa 00 00

11 bb aa 00 ++

00 11

aa bb

bb aa

11 00

’’

(42)

Unit 02 7

### IntroductionIntroduction

zz An element of a Boolean algebra B is An element of a Boolean algebra B is called a

called a constant constant on B.on B.

e.g. 0,a,b,1 in B e.g. 0,a,b,1 in B44..

zz A symbol that may represent any one of A symbol that may represent any one of element of B is called a

element of B is called a (Boolean) (Boolean) variable

variable on B.on B.

e.g.

e.g. x,y,zx,y,z,,……

(43)

Unit 02 8

### IntroductionIntroduction

zz A Boolean expressionA Boolean expression over an algebra over an algebra system (B;

system (B; . . ,+, ,+, ’’ ; 0,1) is defined as ; 0,1) is defined as follows:

follows:

1.1. Any element of B ( constantAny element of B ( constant) is a Boolean expression.) is a Boolean expression.

2.2. Any variableAny variable name is a Boolean expression.name is a Boolean expression.

3.3. If eIf e11 and eand e2 2 are Boolean expression, then eare Boolean expression, then e11’, e, e22’, e, e11+e+e22, , ee11.e.e22 are Boolean expressions.are Boolean expressions.

4.4. Any expression that can be constructed by a finite Any expression that can be constructed by a finite number of applications of the above rules, and

number of applications of the above rules, and onlyonly such a expression is a Boolean expression.

such a expression is a Boolean expression.

(44)

Unit 02 9

### IntroductionIntroduction

zz A A function f(xfunction f(x11,x,x22,,……,,xxnn)),, from

from BBnn to B is called a Boolean functionto B is called a Boolean function if it if it can be specified by a Boolean expression of can be specified by a Boolean expression of n variables x

n variables x11,x,x22,,……,,xxnn .. f(a,b,c

f(a,b,c)=)=abab’’c+ac+a’’b+bb+b’’cc’’

zz Each appearance of Each appearance of a variable or its a variable or its complement

complement in an expression is referred to in an expression is referred to as a

as a literalliteral.. f(a,b,c

f(a,b,c)=)=abab’’c+ac+a’’b+bb+b’’c’c’ has 3 variables,

has 3 variables, a,ba,b,, and and cc, 7 , 7 literals(literals(aa, b, b’’ , c, , c, aa’’, b, b, b, b’’, c, c’’ ).).

n

(45)

Unit 02 10

zz

### inverse) . .

NOT (Complement)NOT (Complement)

InverterInverter 1

0′ = 1′ = 0

1

0

and

0

1 = ′ = =

′ = if X X if X

X

(46)

Unit 02 11

### Basic OperationsBasic Operations

AND OperationAND Operation

..

. .

### B=AB B=AB

AND Gate AND Gate

(47)

Unit 02 12

### Basic OperationsBasic Operations

OR operationOR operation

OR Gate OR Gate

(48)

Unit 02 13

zz

zz

C B

A ′ +

BE D

C

A( + )]′ + [

(49)

Unit 02 14

### Truth TableTruth Table

zz If an expression has If an expression has nn variables, the number of different variables, the number of different combinations of values of the variables is

combinations of values of the variables is 22nn. Therefore, a truth . Therefore, a truth table for n

table for n--variable expression will have variable expression will have 22nn rows.rows.

zz There are functions of There are functions of 2(2n) nn variablesvariables. .

(50)

Unit 02 15

### Truth TableTruth Table

zz AB′ + C = (A + C)(B′ + C)

(51)

Unit 02 16

zz

(52)

Unit 02 17

zz

(53)

Unit 02 18

zz

 = =







(54)

Unit 02 19

zz

zz

zz

(55)

Unit 02 20

### Multiple--Input GatesInput Gates

zz Associative Laws for AND Associative Laws for AND andand OR OR operations.

operations.

(AB)C=A(BC)=ABC (AB)C=A(BC)=ABC

(A+B)+C=A+(B+C)=A+B+C (A+B)+C=A+(B+C)=A+B+C

(56)

Unit 02 21

### Proof of Boolean TheoremsProof of Boolean Theorems

zz By Truth TableBy Truth Table

 Example: X+YZ=(X+Y)(X+Z)Example: X+YZ=(X+Y)(X+Z)

11 11

11 11

11 11

11 11

11 11

11 11

00 00

11 11

11 11

11 11

00 11

00 11

11 11

11 11

00 00

00 11

11 11

11 11

11 11

11 00

00 00

11 00

00 00

11 00

00 11

00 00

00 11

00 00

00 00

00 00

00 00

00 00

(X+Y)(X+Z) (X+Y)(X+Z) X+ZX+Z

X+YX+Y X+YZX+YZ

YZYZ ZZ

YY XX

(57)

Unit 02 22

zz

### By basic laws: By basic laws:

Example:Example: X+YZ=(X+Y)(X+Z)X+YZ=(X+Y)(X+Z)

(58)

Unit 02 23

zz

zz

(59)

Unit 02 24

### Simplification ExamplesSimplification Examples

zz Example: SimplifyExample: Simplify Sol:

Sol:

zz Example: Simplify Example: Simplify

Sol:

Sol:

] ) (

][

[ + + + + + +

= A BC D EF A BC D EF Z

C B A

X

Z = = + ′

) (

) )(

( + ′ + ′ ′ + + ′

= AB C B D C E AB C

Z

) (

) (

) )(

(

then

, )

( Let

+

+ +

= +

=

+

=

+

+ +

+

=

= +

= +

C AB E

C D B Y X Y X Y

C AB E

C D B C AB Z

X E

C D B Y C

AB

(60)

Unit 02 25

### Simplification ExamplesSimplification Examples

zz Example:Example: Find the output Find the output YY of the following of the following circuit and design a simpler circuit having the circuit and design a simpler circuit having the

same output.

same output.

Sol:

Sol:

The resulting circuit contains only

The resulting circuit contains only one ORone OR gate.gate.

A B

A B

B B A A

B)B B

(A

A B))B

(AB B

(A Y

+

= +

+

= +

+

=

+ +

+

=

(61)

Unit 02 26

### Multiplying Out and FactoringMultiplying Out and Factoring

zz SumSum--ofof--products (SOP)products (SOP)

An expression is said to be in

An expression is said to be in sumsum--ofof--productsproducts form when all form when all products are the

products are the products of only single variables.products of only single variables.

zz ProductProduct--ofof--sums (POS)sums (POS)

An expression is said to be in

An expression is said to be in productproduct--ofof--sumssums form when all form when all sums are the

sums are the sums of only single variablessums of only single variables..

form.

SOP in (

form, SOP

in

,

not is EF B)CD

A

are E D C B A E

C A E D C B A

+ +

+

+

+

+

+

form.

POS in

form, POS

in )

( ,

) )(

)(

(

EF is not D)

B)(C (A

are E

D C B A E

C A E D

C B A

+ +

+

+

+

+

+

+ +

(62)

Unit 02 27

zz

zz

(63)

Unit 02 28

zz

### Sol Sol - - 1: 1:

Multiply out the original expression completelyMultiply out the original expression completely and then eliminating redundant terms:

and then eliminating redundant terms:

=A(1+D+E+BC)+BCD+BCE

=A(1+D+E+BC)+BCD+BCE

=A+BCD+BCE

=A+BCD+BCE

### Sol Sol - - 2: 2:

Use (X+Y)(X+Z)=X+YZUse (X+Y)(X+Z)=X+YZ ::

(A+BC)(A+D+E)=A+BC(D+E)=A+BCD+BCE (A+BC)(A+D+E)=A+BC(D+E)=A+BCD+BCE

Updating...

## References

Related subjects :