wiz-icon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

The range of the numbers that can be stored in 8 bits, if negative number are stored in 2's complement form, is

A
128to+128
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
128to127
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
C
127to+128
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
127to+127
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is B 128to127

The range of the numbers that can be stored in 8 bits, if negative number is stored in 2's complement form, is −128 to 127.

A two's complement 8-bit number can only represent positive integers from 0 to 127 (01111111), because the rest of the bit combinations with the most significant bit as '1' represent the negative integers −1 to −128.

Signed char the 8-bit signed char data type can hold integer values in the range of −128 to 127.

2's complement:-

The negative of a binary number represented by switching all ones to zeros and all zeros to ones and then adding one to the result. Two's complement is the way most computers represent positive or negative integers. To get the two's complement negative notation of an integer, we write out the number in binary.



flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Operations on Sets
MATHEMATICS
Watch in App
Join BYJU'S Learning Program
CrossIcon