Sie sind auf Seite 1von 6

COLLEGE OF COMPUTER STUDIES

INFORMATION TECHNOLOGY DEPARTMENT

CCS0001L
(INTRODUCTION TO COMPUTING LABORATORY)

EXERCISE

2
NUMBER SYSTEMS

<STUDENT NAME>

<SECTION>

<DATE>
I. OBJECTIVES
At the end of this exercise, students must be able to:

a) Understand the concepts of number systems.


b) Convert one number system into another.
c) Perform arithmetic operations involving number systems.

II. BACKGROUND INFORMATION

Human beings use a 10 based or decimal number system, possibly because we have ten
fingers and ten toes. Computers use a 2 based or binary system because it can be represented
easily in hardware by on-off, open-closed, charged-uncharged states. For example a capacitor
in RAM memory can be charged or not charged. A charged state represents a 1 and an
uncharged (or not fully charged) state represents a 0. Likewise data stored on a hard disk at
the molecular level can be magnetically aligned in one pattern or its opposite. Each pattern
represents a 1 or 0.

Decimal numbers can be converted to binary numbers, and vice-versa. This is essential as
humans work in decimals and computers work in binary.

Two other forms of number representation can be used to represent integers. They are Octal
and Hexadecimal (Hex for short) systems. The first has a base of 8, the second a base of 16.

This lab helps you understand the methods applied in number system conversion and in
performing arithmetic operations.

III.LABORATORY ACTIVITY

CONVERSION IN DECIMAL, BINARY, OCTAL, AND HEXADECIMAL


TASK 1: COMPLETE THE FOLLOWING TABLE FOR BINARY, OCTAL, AND
HEXADECIMAL NUMBERS. REPRESENT THE BINARY NUMBERS
WITH 4 BITS.

Decimal Binary Octal Hexadecimal Decimal Binary Octal Hexadecimal


0 0000 0 0 8 1000 10 8
1 0001 1 1 9 1001 11 9
2 0010 2 2 10 1010 12 A
3 0011 3 3 11 1011 13 B
4 0100 4 4 12 1100 14 C
5 0101 5 5 13 1101 15 D
6 0110 6 6 14 1110 16 E
7 0111 7 7 15 1111 17 F

TASK 2: NUMBER CONVERSION

1. Binary to Decimal

Binary Decimal
a) 101001102 = 16610
b) 101101112 = 18310

2. Decimal to Binary

Decimal Binary
a) 12510 = 11111012
b) 43610 = 1101101002

3. Octal to Decimal

Octal Decimal
a) 1238 = 8310
b) 7568 = 49410
4. Decimal to Octal

Decimal Octal
a) 9810 = 1428
b) 36910 = 5618

5. Octal to Binary

Octal Binary
a) 2558 = 010 101 1012
b) 12468 = 001 010 100 1102

6. Binary to Octal

Binary Octal
a) 10 110 110 1012 = 26658
b) 111 010 101 0002 = 72508

7. Hexadecimal to Decimal

Hexadecimal Decimal
a) 15A16 = 34610
b) 2FE16 = 76610

8. Decimal to Hexadecimal

Decimal Hexadecimal
a) 9110 = 5B16
b) 59910 = 37716

9. Hexadecimal to Binary

Hexadecimal Binary
a) 5E8D16 = 0101 1110 1000 11012
b) 0F4C16 = 0000 1111 0100 11002

10. Binary to Hexadecimal

Binary Hexadecimal
a) 1001 1110 0011 10012 = 9E3916
b) 10 1101 1010 1100 11012 = 2DACD16
TASK 3: PERFORM ARITHMETIC OPERATIONS

1) 1 1 1 1 1 1 1 0 02 2) 10100011002
1 0 1 0 1 1 0 12 - 1011011112
1 1 0 0 0 1 12 -------------------
+ 1 0 1 1 0 12 100011101
-------------------
1100111001

3) 110110112 4) 11000101012
x 11012 ÷ 11102
-------------------- -------------------
101100011111 111000.0101

5) 1 2 3 4 58 6) 12345678
5 5 6 7 18 - 7654318
+ 1 3 5 78 ---------------
------------- 247136
71615

7) FACE16 8) DECADE16
+ 55A2B16 - DEAD16
-------------- --------------------
654F9 DDEC31

9) CAFÉ16 + 75518 + 1498010 – 2AB16 – 111001012 = ____________10


51966 + 3945 + 14980 - 683 – 229 = 69979

10) 101011012 x 1010 + 650238 – 2F0016 – 1110102 + 1020010 = ____________2


10101101 x 1010 + 110101000010011 – 10111100000000 – 111010 + 10011111011000 =
x 10101101 - 111010
1010 10011111011000
+ 11011000010 10100000010010
110101000010011
111000011010101 – 10111100000000 = 100000111010101 – 10100000010010 =
1100111000011
IV. QUESTION AND ANSWER

Hexadecimal numbers are used as a “shorthand” notation when representing binary addresses
and data. Binary numbers are placed into 4 bit groups and then represented as hex digits. For
example, the 16 bit binary number 1000 0001 1101 0011 can be represented as 81D3 in hex.

One hex digit represents 4 binary digits.

Two hex digits represent 2 byte(s).

Write the hex number 1A0F in binary: 00011010000011112

Das könnte Ihnen auch gefallen