Computer Systems Architecture Assignment 1 Report: 1. Definition: (P1, P3, M1)
Computer Systems Architecture Assignment 1 Report: 1. Definition: (P1, P3, M1)
Computer Systems Architecture Assignment 1 Report: 1. Definition: (P1, P3, M1)
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
-
-
-
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
Same example:
0 10111 10000000
Moreover, floating point addition and substraction use the method of analouge to
the way we do calculations with pencil.
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 :
One more thing that we will get it done by using this form of number:
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:
Taking the fraction from the declared number . Then we can approximate the value since it is
the best way.
5
- Double precision (64-bit) form: (Bias = 1023)
(1)sign (11) exponent (52) fraction
0. 22 / 2−1 = 0.44
0. 44/ 2−2 = 1. 76 ( done because meet the condition already which is 1< = 1.76< 2)
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.
6
Binary 0 01111101 01010001001010101110010111010101
number
-
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.
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