0% found this document useful (0 votes)
16 views

Lecture 1 Number System

Uploaded by

irmn.thandi14
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Lecture 1 Number System

Uploaded by

irmn.thandi14
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 15

COMPUTER

APPLICATIONS IN
PHARMACY
CAP 424
Introduction to Numbering Systems

• We are all familiar with the decimal number


system (Base 10). Some other number systems
that we will work with are:

• Binary  Base 2
• Octal  Base 8
• Hexadecimal  Base 16
Characteristics of Numbering Systems

1) The digits are consecutive.


2) The number of digits is equal to the size of the base.
3) Zero is always the first digit.
4) The base number is never a digit.
5) When 1 is added to the largest digit, a sum of zero and a carry of
one results.
6) Numeric values are determined by the implicit positional values of
the digits.
Binary Number System
• It comprises of only two digits ‘0’ and ‘1’, hence its base is 2.
• There are just two types of electronic pulses present in this
number system: presence of electronic pulse which represents ‘1’
and absence of electronic pulse which represents ‘0’.
• Each digit is known as a bit. There can be two groups of bits, a
group of four bits (1101) which is known as a nibble and a group
of eight bits (11001010) which is known as a byte.
• In a binary number, the position of each bit represents a
particular power of the base (2) of the number system.
Binary to Decimal Conversion
The binary number can be converted to a decimal number by
expressing each digit as a product of the given number 1 or 0 to
the respective power of 2.
Example:

(10101)2= (1 × 24) + (0 × 23) + (1 × 22) + (0 × 21) + (1 × 20) = (21)10


Decimal Number System
• Decimal is a term that describes the base-10 number system,
probably the most commonly used number system.
• The decimal number system consists of ten single-digit numbers:
0, 1, 2, 3, 4, 5, 6, 7, 8 and 9.
Decimal to Binary Conversion
• The decimal number can be converted to a binary number by dividing the given
number by 2 until we obtain the quotient as 1.
• The numbers are written from downwards to upwards.
• Let us understand this using an example.
We can convert 30 to a binary number form in the following way:

The decimal number 30 is expressed


as (30)10= (11110)2.
Decimal to Binary Conversion

(128)10 = (?)2
Octal Number System
Octal Number System has a base of eight and uses the numbers from 0 to 7. The octal numbers, in
the number system, are usually represented by binary numbers when they are grouped in pairs of three.
Any number with base 8 is an octal number like 24 8, 1098, 558, etc.

Octal Number System

Base – 8

Octal Symbol – 0, 1, 2, 3, 4, 5, 6 and 7

1248 = 1 × 82 + 2 × 81 + 4 × 80
Octal Number System
Example 1: Suppose 2158 is an octal number, then it’s decimal
form will be,
2158 = 2 × 82 + 1 × 81 + 5 × 80
= 2 × 64+ 1 × 8 + 5 × 1 = 128 + 8 + 5
= 14110

Example 2: Let 125 is an octal number denoted by 1258. Find the


decimal number.
1258 = 1× 82 + 2 × 81 + 5 × 80
= 1 × 64 + 2 × 8 + 5 × 1 = 64+16+5
=8510
Hexadecimal Number System
• Base 16 system
• Uses digits 0-9 &
letters A,B,C,D,E,F
• Groups of four bits
represent each
base 16 digit
Decimal to Hexadecimal Conversion

Convert 83010 to its hexadecimal equivalent:

830 / 16 = 51 R14 = E in Hex


51 / 16 = 3 R3
3 / 16 = 0 R3

33E16
Hexadecimal to Decimal Conversion
Convert (3B4F)16 to its decimal equivalent:

Hex Digits
3 B 4 F
x x x x
Positional Values
163 162 161 160
Products 12288 +2816 + 64 +15

15,18310
Binary to Hexadecimal Conversion
• The easiest method for converting binary to hexadecimal is to use a
substitution code
• Each hex number converts to 4 binary digits
Any
Queries ?

www.lpu.in Lovely Professional University

You might also like