Skip to content
GATEiit

GATE CSE 2019 Q18: Z = X − Y in sign-magnitude, n-bit operands: minimum bits for Z

Syllabus topic: Number representation and arithmetic (fixed and floating point)

Question

Consider Z=X−Y, where X, Y and Z are all in sign-magnitude form. X and Y are each represented in n bits. To avoid overflow, the representation of Z would require a minimum of:

Try it: multiple choice: exactly one correct option

Select one option
Wrong answer costs 1/3 mark in GATE.
Show answer and explanation

Answer: C (official GATE 2019 final answer key)

Concept used: Subtracting two numbers of opposite sign can double the magnitude, which needs one extra magnitude bit.

Concept notes

Loading notes…

First step: Take the largest positive X and the most negative Y in n-bit sign-magnitude and see how many magnitude bits X−Y needs.

Full step-by-step solution

Loading…

Answer from the official final answer key. Found a mistake? Use Report issue and we will fix it.

More questions on Number representation and arithmetic (fixed and floating point)

Every PYQ on this topic →

Share this question

WhatsAppDownload image

Source: official GATE 2019 CS question paper and final answer key, organised by IIT Madras. Question paper · Answer key