You are on page 1of 15

Computer Systems Architecture

Assignment 1 Report
Student Name: Nguyen Xuan Dung
Student ID: GBH15232
Class: CH0401

Introduction:

Inside assignment 1, it will demonstrate about some basic number systems such as binary,
decimal, hexadecimal, and so on. Additionally, it will provide you with futher knowledge about
bits , bytes and Boolean Gates.

Task 1:

1. Definition: ( P1, P3, M1)


- Binary is a numeric system using two digits which are one and zero. By using only
two digits one and zero, computer can do calculation as well as store a lot of datas.
In aspect of mathematics, a binary number is a number which represented in the
base-2 numeral system will express numeric results using only two symbols( one and
zero). Nowadays, the binary system is used by almost every computers and other
modern devices.Additionally, numeric values are also respented as OFF or ON.
- Digital information is saved in the way of one and zero because computers store
information by one and zero(1-0).
- Each bit has a binary value. For example, a bit may be one or zero.
- This is an example which demonstrate what binary is about.

1
-
-
-

2. - Decimal uses ten digits from zero to nine (0,1,2,3,4,5,6,7,8 and 9). In contrast to
binary which uses only two digits, decimal uses 10 digits to present numbers.
- Hexadecimal is also another number system using ten digits like decimal but it adds
some letters to the system such as A, B , C , D , E and F.
3. Converting decimal number “55” to binary:
- 55 = 2^5x1 + 2^4x1 + 2^3 x 0 + 2^2x1 + 2^1x1 + 2^0x1= 32 + 16 + 0 + 4 + 2 + 1
Decimal Binary
55 110111
4. Converting binary number “10100001” to decimal:
- 10100001 = 2^7x1 + 2^6x0 + 2^5x1 + 2^4x0 + 2^3x0 + 2^2x0 + 2^1x0 + 2^0x1 = 128 +
32 + 1 = 161
Decimal Binary
161 10100001
5. Converting binary number “ 10001111” to hexadicimal:
- Cutting into 2 parts : |1000|1111|
+ 1000 = 8 + 0 + 0 + 0 = 8
2
+ 1111 = 8 + 4 + 2 + 1 = 15
 Finally, we have 10001111 = 8F
6. The reason why hexadecimal is a very useful number system , especially compared to
binary is that it can help you easily in converting to any binary strings even the long one.
7. Adding two decimal numbers together:
Step 1 : put two decimal numbers together in the right column
Step 2 : start adding from right to left using normal adding rules
Step 3 : if it has like 1 + 1, it will equal to 10( write down “0” and take “1” to the next
column)
Step 4: Keep adding to the end
Note: 1 + 1 = 10 ; 1 + 1 + 1 = 11( Do not forget to take the number “1” )
8. Converting hexadecimal “A6C” to decimal:
- A6C = A | 6 | C = 1010 | 0110 | 1100 = 101001101100
- 101001101100 = 2^11 + 0 + 2^ 9 + 0 + 0 + 2^ 6 + 2^5 + 0 + 2^3 + 2^2 + 0 + 0
- = 2048 + 512 + 64 + 32 + 8 + 4 = 2668.
 A6C = 2668.
9. Storing the decimal negative numbers “-35” using two’s complement method:
- 35 = 2^5 x 1 + 2^4 x 0 + 2^3 x 0 + 2^2 x 0 + 2^1 x 1 + 2^0 x 1 = 32 + 2 + 1

Decimal Binary
35 100011
- Change to negative number using one’s complement method: 011100
- Add 1 to change to two’s complement method: 011101

10. Storing large decimal numbers using Binary:


Dividing by 2 , then take all of the remainders from that numbers, it is the way binary
presented.
11. Storing a floating point number using Binary:
Floating point number works in the way with 3 parts ( 2 main)
3
- A Exponent will show the location of binary which related to the initiation of the
significand. A negative exponent express small number( nearly closed to zero)
- A Significand includes digits.Negative significand present negative number’s digit.
- The IEEE-754 single precision floating point standard considers exponent as 8-bit and
23-bit for significand while double precision reagard exponent as 11-bit and 52-bit
for significand.
- FLOATING POINT EXPRESSION:
+ With positive exponent, we change the number that need to be express into
binary form. Then we put that binary into exponent and put 1 in the significand. For
example, express 6410 in the simplified 14-bit floating point model.
 The result for below example is
0 0111 10000000
+ With negative exponent, we will use biased exponent. For our model, values which

Less than 16 are negative,expressing fractional numbers.

Same example:

0 10111 10000000
Moreover, floating point addition and substraction use the method of analouge to
the way we do calculations with pencil.

Storing floating point using Binary:

Step 1: We need to focus on the sign of the number in order to know whether the sign bit is 0
or 1. If the number is positive, then its sign bit is 0 and if the number is negative, then its sign
bit is 1.

4
Step 2: Put the declared number which must be factored need to be larger or equal than 1 and
smaller than 2 ( 1 < = x < 2) and a power of two. Next, we already have the number 1, a
important thing one that need later on for the binary string . Next , we divide the declared
number by a power of two so as to take the “ 1+ fraction” and keep dividing until It satisfies the
condition which we have mentioned above: 1<=x<2. After finished dividing, we will have :

( I will consider the number as x)

x= (x/2−𝑦 ) multiply by 2−𝑦

One more thing that we will get it done by using this form of number:

(-1)signbit * (1+fraction) * 2exponent – bias

Step 3: Looking for the exponent: With the form of floating point number that we have
mentioned above, the exponent is the next thing that we need to do calculation, change into
the single-precision format which is decimal number then we change it into binary number. Till
this step,

We have two case that need to know in order to deal with it:

- The single- precision ( 32-bit) form: (Bias equal to 127)

- The double – precision ( 64- bit ) form: ( Bias equal to 1023)

Step 4: Write the fraction into form of binary number.

Taking the fraction from the declared number . Then we can approximate the value since it is
the best way.

Step 5: Put the binary strings in the correct order.

- Single precision (32-bit) form: (Bias = 127)


(8)
(1)sign (23) fraction
exponent

5
- Double precision (64-bit) form: (Bias = 1023)
(1)sign (11) exponent (52) fraction

Specific example: Convert 0 . 25 into single-precision form

Step 1 : Since 0. 22 is positive number, the sign bit is 0

Step 2: Dividing number by 2−1

0. 22 / 2−1 = 0.44
0. 44/ 2−2 = 1. 76 ( done because meet the condition already which is 1< = 1.76< 2)

After that we have : 1.76 x 2−2 = 0.44

Step 3: Because we use single-precision form so that the bias is 127.

So the exponent = 127 -2 = 125 ( -2 is the power of 2 that we have currently)

Then we change this decimal number into binary number

125 = 01111101

Step 4: We take 0. 76 as the fraction and the we take the number 0.76 times 2 equal to 1.52.
Since the 1.52 is greater than 1, we will have 0.52x2 = 1.04 ( taking the fraction from previous
equation ) since 1.04 is greater than , we add 1 to the fraction again and again for 23 times.

Sign Exponent Fraction


Decimal 0 125 0.76
number

6
Binary 0 01111101 01010001001010101110010111010101
number

Finally we have : 0.16 = 01010001001010101110010111010101.

-
12. ASCII stands for American Standard Code for Information Intercharge. There are up to
128 standard ASCII codes( from 0- 127), each of these character can be presented in 7
bits ( 7 digits binary number).
Some examples about ascii table.

7
13. We can convert alphanumeric characters into binary that allow us to send messages by
using ASCII.

Task 2:

1. Pixel stands for (picture element) which is the basic one for displaying image on the
computer. (P2, P4)

8
9
The picture below shows pictures with different quality(different resolution).

The first is 4-bit, the second is 8-bit and the last one is 24-bit.

2. Storing audio data by using a sequence of bits.

10
Sampling is a method of converting real sound into a digital form which make a
computer store, and so on. Additionally, a digital form contains binary numbers.
Sampling aims at taking a regular measurement of the sound wave at a specific moment
in time.
These are some examples about digital sound waves.

11
3. Logic gates are used for the purpose of creating digital systems.Most of logic gates have
two inputs and one ouput.There are different logic gates: AND, OR, NOT, XOR, and
NAND.
-High voltage = 1 (switch on)
-Low voltage = 0(switch off)
4. The AND gate is an electronic circuit which will gives output is high voltage(1) if all of the
inputs are high voltage(1) too.
AND gate
A B A.B
0 0 0
0 1 0
1 0 0
1 1 1

The OR gate is an electronic circuit which will gives output is high voltage(1) if there is at
least one of the input is high voltage(1).
OR gate
A B A+B
0 0 0
0 1 1
1 0 1
1 1 1

12
The NOT gate is an electronic circuit which give an output and an opposite input of the
output. For example, if the input is B, the output is NOT B.
NOT gate
A 𝐴̅
0 1
1 0

The NAND gate is an electronic circuit which is equal to AND gate supported by a NOT
gate. The output of NAND gates are high voltage if there is at least one of the inputs is
low voltage.
NAND gate
A B ̅̅̅̅̅
𝐴. 𝐵
0 0 1
0 1 1
1 0 1
1 1 0

The EXOR gate: the exclusive-or gate is an electronic circuit which will give output is high
voltage(1) if either, but not both of two inputs are high

EXOR gate
A B Result

13
0 0 0
0 1 1
1 0 1
1 1 0

The Exclusive-NOR gate is an electronic circuit which will give output is low voltage(0) if
either, but not both of two inputs are high.

EXNOR gate
A B Result
0 0 1
0 1 0
1 0 0
1 1 1

Conclusion:
After having done looking through whole report, you will get the idea clearly enough
about the most basic things inside computer. Some of them are basic number systems,
boolean logic and many other things.

Reference List:

14
- Richard, B. (2005). Basic Logic Gates. [online] Ee.surrey.ac.uk. Available at:
http://www.ee.surrey.ac.uk/Projects/CAL/digital-logic/gatesfunc/#logicgates
[Accessed 15 Jun. 2016].
- Dean, G. (1990). Sound sampling: what it is, how it's done, and how to get the most
out of it.. [online] Dgs.clara.net. Available at:
http://www.dgs.clara.net/sampling.htm [Accessed 15 Jun. 2016].
- Floating-point-gui.de. (2016). The Floating-Point Guide - Floating Point Numbers.
[online] Available at: http://floating-point-gui.de/formats/fp/ [Accessed 15 Jun.
2016].
- Ntu.edu.sg. (2016). A Tutorial on Data Representation - Integers, Floating-point
numbers, and characters. [online] Available at:
http://www.ntu.edu.sg/home/ehchua/programming/java/datarepresentation.html
[Accessed 15 Jun. 2016].
-

15

You might also like