CMP223 COAL Assignment 01 PDF
CMP223 COAL Assignment 01 PDF
Resources:
Video Lecture # 06: https://www.youtube.com/watch?v=rb6vaNZf1p8
Video Lecture # 07: https://www.youtube.com/watch?v=4COgD6DM9a8
Problem 1: [5]
Convert 41A716 into their respective binary, decimal, and octal number, if this number is:
a) 2’s complement signed number
b) 1’s complement signed number
c) unsigned number
Also, do show the conversion steps.
Problem 2: [5]
Why do we need separate hardware for subtraction if using sign-magnitude encoding? And do we need
separate hardware for subtraction if using 1’s complement and 2’s complement encoding, explain your
answer in one paragraph.
Problem 3: [7]
Write down a C program that checks the minimum and maximum value that can be stored in signed and
unsigned data types like char, short, int, long, and long long. Does this have something to do with the h/w
and operating system (32 bit or 64 bit)?
Problem 4: [3]
What will be the range of number having 16 bits, if it is a:
a) 2’s complement signed number
b) 1’s complement signed number
c) unsigned number
Problem 5: [5]
By adding the following 2’s complement signed numbers, will overflow occur? If yes, then is it a positive
overflow or a negative overflow? Also, give the status of Carry flag (CF) and Overflow flag (OF). Do show
your work.
a) 0x86 + 0x84
b) 0x7E + 0x70
c) 0xF6 + 0x7E
Problem 6: [10]
Write down a C program that verifies what happens when a signed or unsigned variable of integer data type
overflows? How does C/C++ handle integer overflow in case of signed or unsigned? Also write down how
integer overflows are handled in various programming languages like Java, C#, Python, Javascript.
Problem 8: [10]
Write a one-page note on Unicode Standard. Mention some common encoding formats used by Unicode and
there at least three implementations. Also tell what Unicode encoding format is used by Windows, Linux,
and macOS.
Problem 9: [7]
What is the IEEE-754 standard for floating-point representation and why it was needed? Also, show
floating-point representation using IEEE-754 standard having:
a) 32 bits
b) 64 bits
c) 128 bits
d) 256 bits
And a precision of how many decimal digits did they give depending on their mantissa?
Submission Instructions:
● Solutions to all the parts must be your own hard work. DON'T let anyone copy your assignment. In
case of a copy both students will be awarded a ZERO may be some negative marks as well.
● Attach a cover sheet showing the assignment title, course and your personal information.
● Simply scan the answer sheets of your assignment, generate the pdf
document and push it on your Bitbucket repository. Deadline for submission
of Assignment 01 is Thursday, October 08, 2020 till 11:59pm.
● The title of your assignment should be rollno_Assignment01.
● Late submissions will NOT be accepted. So start doing the problems from today so that you can
submit your assignment in time.