1.1 C Language Number System
1.1 C Language Number System
1.1 C Language Number System
Number Systems
Presented by
Dr Raghu Indrakanti
Assistant Professor
Department of ECE
Problem Solving using Computers
• Introduction
• Algorithms
• Flowcharts and Pseudo code
Overview of C Language
• Introduction
UNIT I
• Salient Features of C Language
• Structure of a C Program
C Language Preliminaries
• Keywords and Identifiers
• Constants
• Variables
• Data Types
• Input-Output Statements with suitable illustrative C Programs
Number System
Technique to Represent and Work with Numbers
3
Binary Number System
2 Digits – 0 and 1
Positional Value System
Each Digit Value Expressed in Powers of 2
5
Hexadecimal Number System
16 Digits – 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
Positional Value System
Each Digit Value Expressed in Powers of 16
6
Number System Relationship
HEXADECIMAL DECIMAL OCTAL BINARY
0 0 0 0000
1 1 1 0001
2 2 2 0010
3 3 3 0011
4 4 4 0100
5 5 5 0101
6 6 6 0110
7 7 7 0111
8 8 10 1000
9 9 11 1001
A 10 12 1010
B 11 13 1011
C 12 14 1100
D 13 15 1101
E 14 16 1110
F 15 17 1111 7
1. Convert the following binary numbers to Decimal numbers.
a) 10011
b) 11001
c) 10101
d) 1110
2. Convert the following Decimal numbers to Binary numbers.
a) 31
b) 54
c) 22
d) 45