Professional Documents
Culture Documents
Date: 16/ 10 / 18
Lab 2
Objectives
Understand different number systems.
Requirements
PC
Description
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
Binary Base 2
Decimal Base 8
Hexadecimal Base 10
Octal Base 16
(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
(11001011)2 ( CB )16
(11110)2 ( 1E )16
(101101)2 (2D )16
(101110101)2 ( 175)1
6
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