









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
This is solution to assignment of Basic Unified Engineering course. It was submitted to Prof. Yasaar Verma at Jiwaji University. It includes: 2's, Complement, Notation, Convert, Base, Compute, Binary, Addition, Bit, String, Overflow
Typology: Exercises
1 / 15
This page cannot be seen from the preview
Don't miss anything!
C5 Solutions
To Compute 0
0 = 00000000
To Compute –
Step 1. Convert 1 to binary 00000001
Step 2. Flip the bits 11111110
Step3. Add 1 11111111
Therefore –1 = 11111111
To Compute –
Step 1. Convert 12 to binary 00001100
Step 2. Flip the bits 11110011
Step3. Add 1 11110100
Therefore –12 = 11110100
Answer = 11110 Overflow = 0 ∴ Answer is correct
01111
Answer = 00000 Overflow = 1 ∴ Answer is incorrect
Answer = 11000 Overflow = 0 ∴ Answer is correct
67 lines: No errors
16 = 2^4 = 2 N-1^ ⇒ N =5.
Five bits are needed to represent the number in excess-16 format.
Step 1. Add 16 to the number 16+12=
Step 2. Convert to binary 12 in excess-16 = 11100
Step1. Set the sign bit to zero since number is positive
Step2. Convert the number into binary representation 29/8 = 3 + 5/ = 011.
Step 3. Normalize the binary representation
0.11101 * 2^2
Step 4.Convert the exponent into excess-
2 = 110
Step 5. Fill in the mantissa
Therefore 29/8 = 01101110
The von Neumann architecture describes a computer with four main sections: the Arithmetic and Logic Unit (ALU) the control unit (CU) the memory the input and output devices (collectively termed I/O) These parts are interconnected by a bundle of wires, a Bus.
; Program name : Subtraction using add only ;Programmer : Joe B ;Last Modified : Sep 16 2003
load R1,1 ;1 added for computing 2's complement load R2,FFh ;mask for flipping the bits load R3,first_number ; load R4, second_number ; xor R5, R4,R2 ; flip the 0's and 1's in the second number addi R5,R5,R1 ; add 1 to the flipped bits to get the 2's complement addi R5,R5,R3 ; add the numbers to obtain A - B halt
first_number: db 8 ;A in A-B second_number: db 5 ;B in A-B