Lab 01 Csi

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

lOMoARcPSD|35493015

Lab 01 - This file will help you understand how computer


operates
Introduction to computing (Trường Đại học FPT)

Scan to open on Studocu

Studocu is not sponsored or endorsed by any college or university


Downloaded by T2.07. Tr?n V?n ??t (sihira7075@gmail.com)
lOMoARcPSD|35493015

CSI106: Founda琀椀ons Of Computer Science

Dura琀椀on: 90’

Lab 1:
Objec琀椀ve:

 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 “Founda琀椀ons Of Computer Science, 4nd Edi琀椀on,
Behrouz Forouzan, 2017.”
Student's task:
- Review the whole chapter 2 content in the textbook.
- Write down solu琀椀ons to exercises (step by step)
- Finish exercises and submit the results to the lecturer in class.

Scoring scale: 10

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

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


Binary

9 1001 7 00000111 255 0000000011111111


7 0111 34 00100010 192 0000000011000000
2 0010 125 01111101 188 0000000010111100
15 1111 157 10011101 312 0000000100111000
12 1100 162 10100010 517 0000001000000101
11 1011 37 00100101 264 0000000100001000
6 0110 66 01000010 543 0000001000011111
5 0101 77 01001101 819 0000001100110011
8 1000 88 01011000 1027 0000010000000011
13 1101 99 01100011 2055 0000100000000111
14 1110 109 01101101 63 0000000000111111

Downloaded by T2.07. Tr?n V?n ??t (sihira7075@gmail.com)


lOMoARcPSD|35493015

Exercise 2 (2.5marks): 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


127 0111 1111 9F 192 0000 0000 11000 000 00C0
125 0111 1101 7D 188 0000 0000 1011 1100 00BC
157 1001 1101 9D 312 0000 0001 0011 1000 0138
162 1010 0010 A2 517 0000 0010 0000 0101 0205
37 0010 0101 25 264 0000 0001 0000 1000 0108
66 0100 0010 42 543 0000 0010 0001 1111 021F
77 0100 1101 4D 819 0000 0011 0011 0011 0333
88 0101 1000 58 1027 0000 0100 0000 0011 0403
99 0110 0011 63 2055 0000 1000 0000 0111 0807
109 0110 1101 6D 63 0000 0000 0011 1111 003F

Exercise 3 (2.5 marks): Compute (b: binary, q: octal, h: hexadecimal)

3245q + 247q = 3514 q = 0000 0111 0100 1100 b


1A7Bh + 26FE7h = 28A62 h = 00101000101001100010 b
1101101101b - 10110111b = 1010110110 b
3654q – 337q = 3315 q = 11011001101 b
3AB7h – 1FAh = 38BD h = 0011100010111101 b
36Ah – 576q = 1EC h = 000111101100 b
64AEh – 1001101b= 62141 q

101101111b
+ 100111011b
110110001b
110001101b

1011010b* 1011b = 1111011110 b


1101000b + 2ABh + 345q = 3F8 h = 1770 q
3AFh / 1Ch = 100001.1010101110000101001 b = 33.67 d
3ACh – 562q = 1000111010 b = 570 d
3FFAh / 327q = 1001100.00101110000101001 b = 76.18 d

Exercise 4 (2.5 marks)

Downloaded by T2.07. Tr?n V?n ??t (sihira7075@gmail.com)


lOMoARcPSD|35493015

1- Show binary formats of 1-byte unsigned numbers: 251, 163, 117


2- Show binary formats of 2-byte unsigned numbers: 551, 160, 443
3- Show binary formats of 1-byte signed numbers: -51, -163, -117, 320
4- Show the decimal values of 1-byte unsigned representations: :
01100011b, 10001111b, 11001010b, 01001100b

1. 251(10) = 11111011(2)
163(10) = 10100011(2)
117(10) = 01110101(2)

2. 551(10) = 0010001000101111(2)
160(10) = 0000000010100000(2)
443(10) = 0000000110101111(2)

3. -51(10) = 11001101(2)
-163(10) = 01011101(2)
-117(10) = 10001011(2)
320(10) = 0000000101000000(2)

4. 01100011(2) = 99(10)
10001111(2) = 143(10)
11001010(2) = 202(10)
01001100(2) = 76(10)

Downloaded by T2.07. Tr?n V?n ??t (sihira7075@gmail.com)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy