{"id":154011,"date":"2023-08-02T11:26:07","date_gmt":"2023-08-02T05:56:07","guid":{"rendered":"https:\/\/www.gkseries.com\/blog\/?p=154011"},"modified":"2023-08-02T11:26:09","modified_gmt":"2023-08-02T05:56:09","slug":"consider-z-x-y-where-x-y-and-z-are-all-in-sign-magnitude-form-x-and-y-are-each-represented-in-%f0%9d%91%9b-bits-to-avoid-overflow-the-representation-of-z-would-require-a-minimum-of","status":"publish","type":"post","link":"https:\/\/www.gkseries.com\/blog\/consider-z-x-y-where-x-y-and-z-are-all-in-sign-magnitude-form-x-and-y-are-each-represented-in-%f0%9d%91%9b-bits-to-avoid-overflow-the-representation-of-z-would-require-a-minimum-of\/","title":{"rendered":"Consider Z = X \u2013 Y, where X, Y and Z are all in sign-magnitude form. X and Y are each represented in \ud835\udc5b bits. To avoid overflow, the representation of Z would require a minimum of"},"content":{"rendered":"\n<p>Q. Consider Z = X \u2013 Y, where X, Y and Z are all in sign-magnitude form. X and Y are each represented in \ud835\udc5b bits. To avoid overflow, the representation of Z would require a minimum of:<\/p>\n\n\n\n<p>(A) \ud835\udc5b bits<\/p>\n\n\n\n<p>(B) \ud835\udc5b \u2212 1 bits<\/p>\n\n\n\n<p>(C) \ud835\udc5b + 1 bits<\/p>\n\n\n\n<p>(D) \ud835\udc5b + 2 bits<\/p>\n\n\n\n<p>Ans: \ud835\udc5b + 1 bits<\/p>\n\n\n\n<p>Solution:<\/p>\n\n\n\n<p>Overflow can occur when two same sign numbers are added or two opposite sign numbers are subtracted.<\/p>\n\n\n\n<p>For example:<\/p>\n\n\n\n<p>let n = 4 bit, X = +6 and Y = -5 (1 bit for sign and 3 bit for magnitude)<\/p>\n\n\n\n<p>Therefore, Z = X &#8211; Y = 6 &#8211; (-5) = 6+5 = 11<\/p>\n\n\n\n<p>But result (Z) 11 needs 5 (= 4 + 1) bits to store,<\/p>\n\n\n\n<p>Sin integer 11 needs 1 bit for sign and 4 bit for magnitude.<\/p>\n\n\n\n<p>Therefore, to avoid overflow, the representation of Z would require a minimum of (n + 1) bits.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Q. Consider Z = X \u2013 Y, where X, Y and Z are all in sign-magnitude form. X and Y are each represented in \ud835\udc5b bits. To avoid overflow, the representation of Z would require a minimum of: (A) \ud835\udc5b bits (B) \ud835\udc5b \u2212 1 bits (C) \ud835\udc5b + 1 bits (D) \ud835\udc5b + 2 [&hellip;]<\/p>\n","protected":false},"author":419,"featured_media":154012,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[5140],"offerexpiration":[],"class_list":["post-154011","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-current-affairs","tag-gate-questions"],"_links":{"self":[{"href":"https:\/\/www.gkseries.com\/blog\/wp-json\/wp\/v2\/posts\/154011","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gkseries.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gkseries.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gkseries.com\/blog\/wp-json\/wp\/v2\/users\/419"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gkseries.com\/blog\/wp-json\/wp\/v2\/comments?post=154011"}],"version-history":[{"count":1,"href":"https:\/\/www.gkseries.com\/blog\/wp-json\/wp\/v2\/posts\/154011\/revisions"}],"predecessor-version":[{"id":154013,"href":"https:\/\/www.gkseries.com\/blog\/wp-json\/wp\/v2\/posts\/154011\/revisions\/154013"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.gkseries.com\/blog\/wp-json\/wp\/v2\/media\/154012"}],"wp:attachment":[{"href":"https:\/\/www.gkseries.com\/blog\/wp-json\/wp\/v2\/media?parent=154011"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gkseries.com\/blog\/wp-json\/wp\/v2\/categories?post=154011"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gkseries.com\/blog\/wp-json\/wp\/v2\/tags?post=154011"},{"taxonomy":"offerexpiration","embeddable":true,"href":"https:\/\/www.gkseries.com\/blog\/wp-json\/wp\/v2\/offerexpiration?post=154011"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}