Sie sind auf Seite 1von 4

Assignment # 1 Due Date: 20/09/2011 CSC 221-Computer Organization and Assembly Language BSCS-4

A) Perform the following conversions (Decimal to other bases) a) 458 = ---------------(Base 3) b) 677 = -------------------(Base 5) c) 652 = -------------------(Base 7) d) 4096 = ------------------(Base 16) Solution: e) 121222 b) 10202 c) 1621 d) 1000 B) Convert the following decimal fraction to Binary with maximum of six places to the right of binary point a) 26.78125 b) 194.03125 c) 298.796875 Solution: a) 11010.11001 b) 11000010..100011 c) 100101010.11101 C) Represent these decimal numbers into binary using 8-bit Signed Magnitude, Ones complement and Twos complement method a) 77 b) -42 c) 119 Solution: a) Signed magnitude: 01001101 One's complement: 01001101 Two's complement: 01001101 b) Signed magnitude: 10101010 One's complement: 11010101 Two's complement: 11010110 c) Signed magnitude: 01110111 One's complement: 01110111 Two's complement: 01110111 d) Perform the following using Two complement method (First convert into binary) a. 2048-1024 b. 256-32 c. 512-128 Solution:

All are powers of two so very simple to convert into binary. Just place number of zeros equal to power of two and place 1 on the left side (as we discussed). Now invert the bits and add 1 to get twos complement. e) Suppose the computer uses 4-bits Ones complement ignoring Overflows. What will be the value stored in J at the end of this pseudo code. J = 0; K = -3; WHILE K 0 J=J+1 K=K-1 END WHILE Solution: J (Binary) K (Binary) -------------- --- ---------------0 0000 -3 1100 1 0001 -4 1011 (1100 + 1110) (where last carry is added to sum doing 1's complement addition 2 0010 -5 1010 (1011 + 1110) 3 0011 -6 1001 (1010 + 1110) 4 0100 -7 1000 (1001 + 1110) 5 0101 7 0111 (1000 + 1110) (This is overflow -- but you can ignore) 6 0110 6 0110 7 0111 5 0101 -7 1000 4 0100 -6 1001 3 0011 -5 1010 2 0010 -4 1011 1 0001 -3 1100 0 0000 Let your computer stores numbers as 3-bits. List all the numbers that can be stored using a. Signed magnitude b. One's complement c. Two's complement Make a table like this All the numbers those can be represented via Signed Magnitude Method f) Simple counting two bits (00,01,10,11) and then adding 1 for ve and 0 for +ve effectively doubling the numbers.

All the numbers those can be represented via Ones complement method All the numbers those can be represented via Twos complement method

g) 0 has two representations and other numbers are simple inversions h) Same as above but 0 has only one representation

G) Make a comparison creating a table shown below between Ones complement and twos complement method. Which one is better and why? One Complement Method Twos Complement Method

Invert bits Two representation of zeros Range small Old systems

Invert bits +add carry One representation of zero Range large Modern systems

H) You have learned Memory Hierarchy. What is rationale behind having so many memories? Describe your answer in your own words just in three lines. I) Give design guidelines of a system having following specifications a) Memory addressable=1024 bytes b) 16-bits can be transferred in/out at a time. c) Numbers are represented in twos complement form in 16 bit format d) Floating point numbers can be expressed in 32-bit format. We want to represent the numbers so big as 1 x 1032 You are required to answer the following just on four lines. 1. Address bus width of your system 2. Data Bus width 3. Range of numbers represented in twos complement form 4. No of bits needed to represent floating point numbers Mantissa and Exponential part. Solution: Memory Hierarchy exploits the locality of reference principle and thus successfully achieve the balance between performance and cost (cost vs. performance trade off) 1. 10 bits 2. Data bus16 bits 3. Divide the 65535 (range) half for eve and half for +ve

4. Exponent=5 bits, 1 bit for +ve or ve and remaining for precision of numbers Marks are on your effort even if you do wrong. Copied assignments will be marked straight Zero. Write in your own words. Submission: Submit me hard copy handwritten or printed but your own words. sure that the title page shows all information shown in box below.. Assignment # 1 CSC 221-Computer Organization and Assembly Language <STUDENT NAME HERE> <STUDENT REGISTRATION# HERE> <STUDENT CLASS AND SECTION# HERE> SUBMISSION DATE: <DATE AT WHICH YOU ARE HANDING > DUE DATE: <when was it due> Make

Das könnte Ihnen auch gefallen