Docsity

Binary Numbers and Logic Operations - Introduction to Computing - Lecture Slides, Slides of Introduction to Computing

Partial preview of the text

Download Binary Numbers and Logic Operations - Introduction to Computing - Lecture Slides and more Slides Introduction to Computing in PDF only on Docsity!

CS101 Introduction to Computing

Lecture 8

Binary Numbers & Logic Operations

The focus of the last lecture was on the microprocessor

  • During that lecture we learnt about the function of the central component of a computer, the microprocessor
  • And its various sub-systems
    • Bus interface unit
    • Data & instruction cache memory
    • Instruction decoder
    • ALU
    • Floating-point unit
    • Control unit

BINARY

(BASE 2)

numbers

DECIMAL

(BASE 10)

numbers

Binary (base 2) number system consists of just two

Other popular number systems

  • Octal
    • base = 8
    • 8 symbols (0,1,2,3,4,5,6,7)
  • Hexadecimal
    • base = 16
    • 16 symbols (0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F)

Decimal (base 10) numbers are expressed in the positional notation

4202 = 2x10^0 + 0x10^1 + 2x10^2 + 4x10^3

1โ€™s multiplier

1

Decimal (base 10) numbers are expressed in the positional notation

4202 = 2x10^0 + 0x10^1 + 2x10^2 + 4x10^3

10โ€™s multiplier

10

Decimal (base 10) numbers are expressed in the positional notation

4202 = 2x10^0 + 0x10^1 + 2x10^2 + 4x10^3

1000โ€™s multiplier

1000

Binary (base 2) numbers are also expressed in the positional notation

10011 = 1x2^0 + 1x2^1 + 0x2^2 + 0x2^3 + 1x2^4

The right-most is the least significant digit

The left-most is the most significant digit

Binary (base 2) numbers are also expressed in the positional notation

10011 = 1x2^0 + 1x2^1 + 0x2^2 + 0x2^3 + 1x2^4

2โ€™s multiplier

2

Binary (base 2) numbers are also expressed in the positional notation

10011 = 1x2^0 + 1x2^1 + 0x2^2 + 0x2^3 + 1x2^4

4โ€™s multiplier

4

Binary (base 2) numbers are also expressed in the positional notation

10011 = 1x2^0 + 1x2^1 + 0x2^2 + 0x2^3 + 1x2^4

16โ€™s multiplier

16

Counting in Decimal

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

20 21 22 23 24 25 26 27 28 29

30 31 32 33 34 35 36 . . .

0 1 10 11 100 101 110 111 1000 1001

1010 1011 1100 1101 1110 1111 10000 10001 10010 10011

10100 10101 10110 10111 11000 11001 11010 11011 11100 11101

11110 11111 100000 100001 100010 100011 100100 . . .

Counting

in Binary