You are on page 1of 5

Introduction to Computing and Programming

Date: 16/ 10 / 18

Department of Forensic Computing and Cyber Security


College of Computer Science and Information Technology

Lab 2

Objectives
Understand different number systems.

Lab Learning Outcomes (LLO)


The students should be able to
Identify how Computers Store Data and understand how Computer Number Systems
works

Requirements
 PC

 Description

How Computers Store Data


Most computers are digital
 Recognize only two discrete states: on or off
 Use a binary system to recognize two states
 Use number system with two unique digits: 0 and
1, called bits (short for binary digits)
 Smallest unit of data computer can process

What is a byte?
Eight bits grouped together as a unit
Provides enough different combinations of 0s and 1s to represent 256 individual characters:
 Numbers
 Uppercase and lowercase letters
 Punctuation marks
Introduction to Computing and Programming
Date: 16/ 10 / 18

Storing Numbers
A bit can be used in a very limited way to represent numbers.
Depending on whether the bit is turned on or off, it can represent one of two different values.
In computer systems, a bit that is turned off represents the number 0 and a bit that is turned on
represents the number 1
This corresponds perfectly to the binary numbering system.
In the binary numbering system (or binary, as it is usually called) all numeric values are written
as sequences of 0s and 1s. Here is an example of a number that is written in binary:
10011101
The position of each digit in a binary number has a value assigned to it.
Starting with the rightmost digit and moving left

Assessment
Exercises on numbering system and Data Representation Exercises
Use Calculator for easy converging

1) Open calculator in your windows 10


Introduction to Computing and Programming
Date: 16/ 10 / 18

2) Change the calculator to the programmer mood.

3) Start by looking how it works.


Introduction to Computing and Programming
Date: 16/ 10 / 18

Q1: Match the following with its correct base

Binary Base 2

Decimal Base 8

Hexadecimal Base 10

Octal Base 16

Q2: Conversion from Decimal to binary

(100)10  (1100100)2
(88)10  (1011000)2
(101)10  (1100101)2
(98)10  (1100010)2
(27)10  (11011)2
Q2 : Conversion from binary to Decimal

(101101)2  (45)10
(1001100)2  (76)10
(11001011)2  (203)10
(11110)2  (30)10
Q3: Conversion from Hexadecimal to Binary

B410 (1011010000 010000)2


ECD1 (1110110011010001)2
30A (110000101 0)2
Introduction to Computing and Programming
Date: 16/ 10 / 18
ABC (101010111100 )2
D3 (11010011 )2
Q4: Conversion from Binary to Hexadecimal

(11001011)2  ( CB )16
(11110)2  ( 1E )16
(101101)2  (2D )16
(101110101)2  ( 175)1
6

(101110101)2  (175 )16


A

Q5: Use the ASCII code to find the ASCII code for the characters:
E 69
e 101
* 42
% 37
4 52
9 57
Z 90
" 34
Q6: How many distinct values can we represent with

a) 4 bits
b) 5 bits
c) 4 bits have 16 distinct values
d) 5 bits have 32 distinct values

You might also like