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

Lab 01

This document outlines a lab assignment on number systems where students are asked to review a textbook chapter on representing numbers in binary, octal, hexadecimal and decimal formats. Students are given exercises to convert between these number systems and represent numbers in different bit lengths, which are scored on a scale of 10 points. The exercises cover topics like converting decimal numbers to other bases, representing numbers as different bit lengths, and determining decimal values from binary representations.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views

Lab 01

This document outlines a lab assignment on number systems where students are asked to review a textbook chapter on representing numbers in binary, octal, hexadecimal and decimal formats. Students are given exercises to convert between these number systems and represent numbers in different bit lengths, which are scored on a scale of 10 points. The exercises cover topics like converting decimal numbers to other bases, representing numbers as different bit lengths, and determining decimal values from binary representations.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

CSI104: Foundations Of Computer Science Fullname:

Duration: 60’ RollNumber:

Class:
Lab 1:
Objective:

 Describe the decimal, binary, hexadecimal, and octal system.


 Convert a number in binary, octal, or hexadecimal to a number in the decimal system.
 Convert a number in the decimal system to a number in binary, octal, and hexadecimal.
 Convert a number in binary to octal and vice versa.
Materials:
Based on exercises of chapter 2 in the textbook “Foundations Of Computer Science, 4nd Edition,
Behrouz Forouzan, 2017.”
Student's task:
- Review the whole chapter 2 content in the textbook.
- Write down solutions to exercises (step by step)
- Finish exercises and submit the results to the lecturer in class.

Scoring scale: 10

Exercise 1 (4.0 marks): Convert decimal numbers to binary ones

Decimal 4-bit Decimal 8-bit Decimal 16-bit Binary


Binary Binary
9 1001 117 255
7 13 370
2 100 287
15 64 232
12 24 146
11 37 392
6 59 281
5 120 518
8 113 135
13 29 2055
14 109 63
Exercise 2 (2.0 marks): Convert decimal numbers to binary and hexadecimal ones

Decimal Binary Hexa. Decimal 16-bit Binary Hexadecimal

9 1001 9 255 0000 0000 1111 1111 00FF


117 370
13 287
100 232
64 146
24 392
6 281
5 518
8 135
15 2055
14 63

Exercise 3 (4.0 marks)

1- Show binary formats of 1-byte 2- Show binary formats of 2-byte unsigned


unsigned numbers: numbers:

a. 251 = a. 551 =

b. 163 = b. 160 =

c. 117 = c. 443 =

3- Show binary formats of 1-byte signed 4- Show the decimal values of 1-byte
numbers: unsigned representations:

a. -51 = a. 01100011b =

b. -163 = b. 10001111b =

c. -117 = c. 11001010b =

d. 320 = d. 01001100b =

You might also like