Chapter 03 The Language of Bits
Chapter 03 The Language of Bits
Chapter 03 The Language of Bits
PROPRIETARY MATERIAL. © 2014 The McGraw-Hill Companies, Inc. All rights reserved. No part of this PowerPoint slide may be displayed, reproduced or distributed in any form or by any
means, without the prior written permission of the publisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual course preparation.
PowerPoint Slides are being provided only to authorized professors and instructors for use in preparing for classes using the affiliated textbook. No other use or distribution of this PowerPoint slide
is permitted. The PowerPoint slide may not be sold and may not be distributed or be used by any student or any other third party. No part of the slide may be reproduced, displayed or distributed in
any form or by any means, electronic or otherwise, without the prior written permission of McGraw Hill Education (India) Private Limited.
1
Outline
Boolean Algebra
Positive Integers
Negative Integers
Floating-Point Numbers
Strings
2
What does a Computer Understand ?
Computers do not understand natural human languages, nor
programming languages
They only understand the language of bits
Bit 0 or 1
Byte 08 or
bits1
Word 40bytes
or 1
megaByte 1006 or
bytes
1
3
Number systems
Is defined as a system of writing to express numbers.
It is the mathematical notation for representing numbers of a given set
by using digits or other symbols in a consistent manner.
It provides a unique representation of every number and represents the
arithmetic and algebraic structure of the figures.
It also allows us to operate arithmetic operations like addition,
subtraction, multiplication and division.
The value of any digit in a number can be determined by:
The digit
Its position in the number
The base of the number system
Types of Number Systems
Used by Used in
System Base Symbols humans? computers?
Decimal 10 0, 1, … 9 Yes No
Binary 2 0, 1 No Yes
Octal 8 0, 1, … 7 No No
Hexa- 16 0, 1, … 9, No No
decimal A, B, … F
Quantities/Counting (1)
Hexa-
Decimal Binary Octal decimal
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
Quantities/Counting (1 of 2)
Hexa-
Decimal Binary Octal decimal
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
15 1111 17 F
Conversion Among Bases
• The possibilities:
Decimal Octal
Binary Hexadecimal
Binary to decimal Conversion
Decimal-to-Binary
Conversion
Binary-to-Decimal
Conversion
Binary to decimal Conversion
Humans use base ten (or decimal), because we have ten fingers and
that digital electronics uses base-two (binary) because it only
understands two states; ON and OFF.
For students to be able to analyze and design digital electronics,
they need to be proficient at converting numbers between these
two number systems.
Base ten has ten unique symbols (0 – 9) while binary has two unique
symbols (0 – 1). Any number can represent a base and the number of
symbols it utilizes will always be that number.
Binary to decimal Conversion
The Process : Weighted Multiplication
a) Multiply each bit of the Binary Number by it corresponding bit-weighting
factor (i.e. Bit-0→20=1; Bit-1→21=2; Bit-2→22=4; etc).
b) Sum up all the products in step (a) to get the Decimal Number.
Example:
Convert the decimal number 01102 into its decimal equivalent.
0 1 1 0
0110 2 = 6 10
8 4 2 1
0 + 4 + 2 + 0 = 610
Review of Logical Operations
A + B (A or B) A B A+B
0 0 0
1 0 1
0 1 1
1 1 1
A B A.B
A.B ( A and B) 0 0 0
1 0 0
0 1 0
1 1 1
15
Review of Logical Operations - II
A B A NAND B A B A NOR B
0 0 1 0 0 1
1 0 1 1 0 0
0 1 1 0 1 0
1 1 0 1 1 0
16
Review of Logical Operations
XOR Operation : (A B)
A B A XOR B
0 0 0
1 0 1
0 1 1
1 1 0
17
De Morgan's Laws
A + B = A.B
A.B = A + B
18
Binary Number System
19
Hexadecimal and Octal Numbers
Hexadecimal numbers
Base 16 numbers – 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
Start with 0x
Octal Numbers
Base 8 numbers – 0,1,2,3,4,5,6,7
Start with 0
20
ASCII Character Set
ASCII – American Standard Code for Information
Interchange
It has 128 characters
First 32 characters (control operations)
backspace (8)
line feed (10)
escape (27)
Each character is encoded using 7 bits
21
ASCII Character Set
Character Code Character Code Character Code
a 97 A 65 0 48
b 98 B 66 1 49
c 99 C 67 2 50
d 100 D 68 3 51
e 101 E 69 4 52
f 102 F 70 5 53
g 103 G 71 6 54
h 104 H 72 7 55
i 105 I 73 8 56
j 106 J 74 9 57
k 107 K 75 ! 33
l 108 L 76 # 35
m 109 M 77 $ 36
n 110 N 78 % 37
o 111 O 79 & 38
p 112 P 80 ( 40
q 113 Q 81 ) 41
r 114 R 82 * 42
s 115 S 83 + 43
t 116 T 84 , 44
u 117 U 85 . 46
v 118 V 86 ; 59
w 119 W 87 = 61
x 120 X 88 ? 63
y 121 Y 89 @ 64
z 122 Z 90 ^ 94
22
THE END
23