New Bpharm Notes Unit 1 Half
New Bpharm Notes Unit 1 Half
Pharm. Students
Introduction
Number systems are the backbone of how computers process data, which is
vital in pharmacy for managing drug inventories, barcodes, and electronic
records
Example: 1011
= (1 × 2³) + (0 × 2²) + (1 × 2¹) + (1 × 2⁰)
=8+0+2+1
= 11 in decimal.
Example: 245
= (2 × 10²) + (4 × 10¹) + (5 × 10⁰)
= 200 + 40 + 5
= 245.
Example: 2AF
= (2 × 16²) + (10 × 16¹) + (15 × 16⁰)
= 512 + 160 + 15
= 687 in decimal.
3. Conversions
Rule: Divide the decimal number by 2, record the remainder. Repeat until the quotient is
0. The binary number is the remainders read in reverse.
Example: Convert 97 to binary
97 ÷ 2 = 48 remainder 1
48 ÷ 2 = 24 remainder 0
24 ÷ 2 = 12 remainder 0
12 ÷ 2 = 6 remainder 0
6 ÷ 2 = 3 remainder 0
3 ÷ 2 = 1 remainder 1
1 ÷ 2 = 0 remainder 1
Binary = 1100001
Rule: Multiply each bit by 2 raised to its position index (starting from 0 on the right),
then add all results.
Example: Convert 1100001 (binary) to decimal
(1 × 2⁶) + (1 × 2⁵) + (0 × 2⁴) + (0 × 2³) + (0 × 2²) + (0 × 2¹) + (1 × 2⁰)
= 64 + 32 + 0 + 0 + 0 + 0 + 1
= 97
Rule: Multiply each digit by 8 raised to its position index (starting from 0 on the right),
then add all results.
Example: Convert 141 (octal) to decimal
(1 × 8²) + (4 × 8¹) + (1 × 8⁰)
= (1 × 64) + (4 × 8) + (1 × 1)
= 64 + 32 + 1
= 97
Rule: Multiply each digit by 16 raised to its position index (starting from 0 on the right),
then add all results.
Example: Convert 61 (hex) to decimal
(6 × 16¹) + (1 × 16⁰)
= (6 × 16) + (1 × 1)
= 96 + 1
= 97
4. Binary Operations
o Why This Number?: I chose 100 (4) and 101 (5) because
they’re small numbers, and their sum (9) introduces a carry,
showing how binary addition handles carries without being too
complex.
o 100
+ 101
o Why This Number?: I picked 1101 (13) and 100 (4) because
they’re small, and the subtraction doesn’t require borrowing,
making the direct method simple to follow.
o 1101
- 0100
o Step 2: Subtract from right to left:
Rightmost: 1 - 0 = 1.
Next: 0 - 0 = 0.
Next: 1 - 1 = 0.
Leftmost: 1 - 0 = 1.
1→0
0→1
0→1
o Why This Number?: I used the same numbers (1101 and 100)
from the direct subtraction to show how Two’s complement
achieves the same result, reinforcing the concept with
consistency.
o 1101
+ 100
o Why This Number?: I chose 110 (6) and 10 (2) because they’re
small, and their product (12) results in a 4-bit number (1100),
showing a simple multiplication with a 0 bit in the multiplier.
o 000
+ 1100
5. Pharmacy Application
Number systems are used in pharmacy for managing drug databases. For
example, a drug ID might be stored as binary 1001 (9 in decimal) in a
computer system. When you scan a barcode, the system converts it to
decimal to display the drug ID as 9, ensuring accurate drug identification.