I would just like an explanation, in a simple way if possible, to describe why t
ID: 3741681 • Letter: I
Question
I would just like an explanation, in a simple way if possible, to describe why the given solutions are correct/incorrect
Decimal example of the problem that computers have to deal with. 523 765 1,288 which is not a problem if there is 4 positions for the result. It is a big problem if 3 positions for the result Binary Example using 8-bits Ex 2 Ex 3 Ex 4 +0100 0010 +0000 0001 +0100 0001 +1100 0001 0111 0101 10000 0000 1001 110111001 1101 Z-0, N-0, C-0, V-0 51 66- 117110 Correct Z-0, N-1, C-0, V-1 92 65-99 Incorrect Negative Overflow Z-1, N-0, C=1, V-0 36 63--99 Correct Lero Carry Correct Negative CarryExplanation / Answer
Ex-1
here,
Z=0 (not set because zesult is not zero)
N=0 (not set because result is positive)
C=0 (not set because the operation does'nt produce a carry )
V=0 (not set because operation does'nt create an overflow i.e. P + P = P )
the solution is correct because there is no overflow and no interference with the sign bit(msb).
Ex-2
here,
Z=1 ( set because zesult is zero)
N=0 (not set because result is positive)
C=1 ( set because the operation produces a carry )
V=0 (not set because operation does'nt create an overflow since different sign operands never create an overflow)
the solution is correct because there is no overflow and no interference with the sign bit(msb) as we ignore the carry bit.
Ex-1
Z=0 (not set because zesult is not zero)
N=1 (set because result is negative)
C=0 (not set because the operation does'nt produce a carry )
V=1 (set because operation creates an overflow i.e. P + P = N )
the solution is incorrect because there is an overflow due to which the sum of two positive numbers results in a negative number i.e. mathematically incorrect.
Ex-1
Z=0 (not set because zesult is not zero)
N=1 (set because result is negative)
C=1 (set because the operation produces a carry )
V=0 (not set because operation does'nt create an overflow i.e. N + N = N)
the solution is correct because there is no overflow and no interference with the sign bit(msb) as carry is being ignored which may contain an error.
thank you!!
please dont forget to upvote :)