Q: 1 Which of the following is not a weighted code?
Gray
8421
Excess-3
BCD
[ Option A ]
A weighted code is a binary code in which each bit position has a fixed weight, and the value of a digit is obtained by adding the weights of the bits that are 1.
In the 8421 Code, the weights of the four bits are 8, 4, 2, and 1, and the decimal value is calculated directly from these weights.
E.g.:
BCD (Binary Coded Decimal) is also based on the 8421 code, so it is a weighted code as well.
| DECIMAL | 4-BIT BCD |
|---|---|
| 0 | 0000 |
| 1 | 0001 |
| 2 | 0010 |
| 3 | 0011 |
| 4 | 0100 |
| 5 | 0101 |
| 6 | 0110 |
| 7 | 0111 |
| 8 | 1000 |
| 9 | 1001 |
Note:
In BCD, each decimal digit from 0 to 9 is represented using 4 bits. Only 10 combinations are valid from 0000 to 1001. The remaining combinations (1010 to 1111) are invalid. Therefore, BCD is strictly limited to digits 0 to 9.
In Excess-3 Code, we first add 3 to the decimal digit and then convert it into binary. For example, to represent decimal 4, we add 3 and get 7, whose binary form is 0111.
| DECIMAL | BINARY | DECIMAL + 3 | EXCESS-3 CODE |
|---|---|---|---|
| 0 | 0000 | 0+3=3 | 0011 |
| 1 | 0001 | 1+3=4 | 0100 |
| 2 | 0010 | 2+3=5 | 0101 |
| 3 | 0011 | 3+3=6 | 0110 |
| 4 | 0100 | 4+3=7 | 0111 |
| 5 | 0101 | 5+3=8 | 1000 |
| 6 | 0110 | 6+3=9 | 1001 |
| 7 | 0111 | 7+3=10 | 1010 |
| 8 | 1000 | 8+3=11 | 1011 |
| 9 | 1001 | 9+3=12 | 1100 |
Although Excess-3 follows a fixed procedure, the bit positions themselves do not have fixed weights, so it is treated as a Non-Weighted Code.
In Gray code, there are no positional weights at all. Its main feature is that consecutive numbers differ by only one bit.
For example, decimal 2 is 010 in binary but 011 in gray code, and decimal 3 is 011 in binary but 010 in gray code.
RULE FOR GENERATING GRAY CODE:
For example, obtained the gray code for the number 13.
Binary Number : 13 : 1101
| Step | Binary Bits | Gray Bit |
|---|---|---|
| MSB | 1 | 1 |
| Next Bit | 1⊕1 | 0 |
| Next Bit | 0⊕1 | 1 |
| Last Bit | 1⊕0 | 1 |
So Gray code for binary 1101 is 1011.
| Decimal | Gray Code |
|---|---|
| 0 | 000 |
| 1 | 001 |
| 2 | 011 |
| 3 | 010 |
| 4 | 110 |
| 5 | 111 |
| 6 | 101 |
| 7 | 100 |
In Gray code, consecutive numbers (next higher number) differ by only one bit. Means only one bit position changes either from 0 to 1 or from 1 to 0. All other bits remain the same. This property is called the Unit Distance property.
E.g.:
BINARY VS GRAY (3-BIT NUMBERS):
| DECIMAL | BINARY | BITS CHANGED | GRAY CODE | BITS CHANGED |
|---|---|---|---|---|
| 0 | 000 | - | 000 | - |
| 1 | 001 | 1 | 001 | 1 |
| 2 | 010 | 2 | 011 | 1 |
| 3 | 011 | 1 | 010 | 1 |
| 4 | 100 | 3 | 110 | 1 |
| 5 | 101 | 1 | 111 | 1 |
| 6 | 110 | 1 | 101 | 1 |
| 7 | 111 | 1 | 100 | 1 |
We cannot calculate the decimal value by adding bit weights, which shows that Gray Code is not a weighted code.
Here both Excess-3 and Gray Code are Non-Weighted Code, but the most standard and commonly expected answer in exams is GRAY CODE, as it is clearly and purely non-weighted.
Q: 2 The range of numbers that can be stored in 8-bits, if negative numbers are stored in 2’s complement form is?
-128 to +128
-128 to +127
-127 to +128
-127 to +127
[ Option B ]
In 2’s complement form, one bit is used as the sign bit and the remaining bits are used to represent the magnitude. For an n-bit 2’s complement number, the range of values that can be represented as -2n−1 to +(2n−1 -1).
Now, for 8 bits, -27 to + (27-1) = -128 to +127
So, the smallest number that can be stored is -128, and the largest number is +127.
Q: 3 Which of the following is the representation of decimal number (-147) in 2’s complement notation of a 12-bit machine?
111101101100
110001001101
111101101101
000001101101
[ Option C ]
In a 2’s complement representation, a negative number is obtained by taking the 1’s complement of its positive binary form and then adding 1.
First convert (147)10 to binary and write in 12-bit representation.
(147)10=(000010010011)2
1’s complement of 000010010011 = 111101101100
2’s complement = 111101101100 + 1 = 111101101101
Finally, (-147)10=(111101101101)2
Q: 4 How many bits are required to store an ASCII character?
7
6
8
None of these
[ Option A ]
ASCII (American Standard Code for Information Interchange) is a character encoding scheme used to represent letters, digits, and special symbols in computers. In its original and standard form, ASCII defines 128 different characters.
To represent 128 different characters, we need a minimum number of bits such that 2n=128. Since 27=128, 7 bits are sufficient to store one ASCII character. That is why standard ASCII uses 7 bits per character.
Q: 5 Given, √(224)r = (13)r, the value of radix r is?
10
8
6
5
[ Option D ]
A number written with a subscript r means it is expressed in base (radix) r.
First remove the square root by squaring both sides and then convert both numbers into decimal form.
(224)r=(13)2r
Convert each side into decimal:
Left-hand side: (224)r = 2r2+2r1+4r0 = 2r2+2r+4
Right-hand side: (13)r = 1r1+3r0 = (r+3)
After squaring (r+3)2 = r2+6r+9
Now the equation,
= 2r2+2r+4 = r2+6r+9
= 2r2+2r+4-r2-6r-9=0
= r2-4r-5=0
=(r−5)(r+1)=0
=r=5 or r=−1
The r can be either 5 or -1 but the radix cannot be negative and also the largest digit used is 4, so radix must be greater than 4.
Therefore, r=5.
Q: 6 The decimal equivalent of the hexadecimal operation (A10+B21) is?
5425
5246
2849
5344
[ Option A ]
To find the decimal equivalent of the hexadecimal operation (A10+B21)16, we first convert each hexadecimal number into decimal form and then add the results.
(A10)16 = 10*162+1*161+0*160=2560+16+0 = (2576)10
(B21)16 = 11*162+2*161+1*160=2816+32+1 = (2849)10
Now, adding 2576+2849 = 5425.
Q: 7 In order to store floating point numbers in computers using the normalized representation and 32-bit single precision, the number of bits used for exponent and fraction are _______, _________ respectively.
11, 21
16, 15
16, 16
8, 23
[ Option D ]
Computers store real (floating-point) numbers using the IEEE 754 standard. In 32-bit single-precision floating-point representation, the total 32 bits are divided into three parts:
| Field | Number of Bits |
|---|---|
| Sign | 1 |
| Exponent | 8 |
| Fraction (Mantissa) | 23 |
Q: 8 The least significant bit of the binary number, which is equivalent to any odd decimal number is?
0
1
1 or 0
All of the above
[ Option B ]
In the binary number system, the Least Significant Bit (LSB) is the rightmost bit. This bit plays an important role in determining whether a number is odd or even. If the LSB is 0, the number is even. If the LSB is 1, the number is odd.
Now consider any odd decimal number, such as 1, 3, 5, 7, or 9. When these numbers are converted into binary form, they always end with 1.
| Decimal Number | Binary Equivalent | Least Significant Bit (LSB) |
|---|---|---|
| 0 | 0000 | 0 |
| 1 | 0001 | 1 |
| 2 | 0010 | 0 |
| 3 | 0011 | 1 |
| 4 | 0100 | 0 |
| 5 | 0101 | 1 |
| 6 | 0110 | 0 |
| 7 | 0111 | 1 |
| 8 | 1000 | 0 |
| 9 | 1001 | 1 |
Q: 9 Which of the following binary numbers represents an invalid BCD code?
0101
1001
0111
1011
[ Option D ]
BCD (Binary-Coded Decimal) represents decimal digits 0 to 9 using 4-bit binary codes.
| Decimal | BCD Code |
|---|---|
| 0 | 0000 |
| 1 | 0001 |
| 2 | 0010 |
| 3 | 0011 |
| 4 | 0100 |
| 5 | 0101 |
| 6 | 0110 |
| 7 | 0111 |
| 8 | 1000 |
| 9 | 1001 |
🔶 BCD Valid Range: 0000 to 1001
🔶 1011 = 11 (which is not a valid decimal digit in BCD)
Q: 10 Assuming all numbers are in 2’s complement representation, which of the following numbers is divisible by 11111011?
11100100
11010111
11011011
11100111
[ Option D ]
In 2’s complement representation, if the Most Significant Bit (MSB) is 1, the number represents a negative value. To find its decimal equivalent, we can use either of the following two correct methods.
In the first method, we subtract the unsigned binary value from 2n, where n is the total number of bits, and then place a negative sign before the result.
In the second, more commonly used method, we first find the 1’s complement of the binary number by inverting all bits, then add 1 to obtain the 2’s complement, and finally convert the result to decimal and assign a negative sign.
First, let us find the value of the divisor:
USING FIRST METHOD:
Given Number : (11111011)2
This is an 8-bit number with MSB = 1, so it is negative.
256-251 = 5 : Value : -5
USING SECOND METHOD:
Given Number : (11111011)2
1’s Complement : 00000100
2's Complement : 00000100 + 1 = (00000101)2
(000000101)2 = 5 : Value : -5
So, the question becomes, which option is divisible by -5? Remember, if a number is divisible by 5, it is also divisible by -5 and a number divisible by -5 must be a multiple of 5.
| OPTION | BINARY NUMBER | MSB | DECIMAL VALUE (2’S COMPLEMENT) | DIVISIBLE BY 11111011 (-5) |
|---|---|---|---|---|
| (A) | 11100100 | 1 | 256-228=28 : -28 | No |
| (B) | 11010111 | 1 | 256-215=41 : -41 | No |
| (C) | 11011011 | 1 | 256-219=37 : -37 | No |
| (D) | 11100111 | 1 | 256-231=25 : -25 | Yes |
Q: 11 Binary 101110.11 is equal to -
(56.6)8 only
(46.75)10 only
(2E.C)16 only
All options are correct
[ Option D ]
| Number System | Value | Conversion Steps |
|---|---|---|
| Binary | 101110.11 | Given, original number. |
| Decimal | 46.75 | Integer: 101110 : 46 Fraction: .11 : 0.75 |
| Octal | 56.6 | Integer: 101110 : 101 110 : 56 Fraction: .11 : .110 : 6 |
| Hexadecimal | 2E.C | Integer: 101110 : 0010 1110 : 2E Fraction: .11 : .1100 : C |
Q: 12 If the 2’s complement representation of a number is (011010)2, what is its equivalent hexadecimal representation?
(110)16
(1A)16
(16)16
(26)16
[ Option B ]
In 2’s complement, if the MSB is 0, the number is positive, and its value is the same as ordinary binary.
Here, in the given number (011010)2 has MSB is 0. So, it is positive number.
Now, convert binary to hexadecimal. Group the bits into 4-bit nibbles. If needed pad with leading zeros.
(011010)2 : (0001 1010)2
(0001)2 = (1)16
(1010)2 = (A)16
So, (011010)2 = (1A)16
Q: 13 When the value of (37)16 is divided by (17)16, the remainder is?
(C0)16
(03)16
(07)16
(09)16
[ Option D ]
To find the remainder when (37)16 is divided by (17)16, it is easiest to first convert both hexadecimal numbers into decimal, perform the division, and then convert the remainder back into hexadecimal.
(37)16 = (55)10
(17)16 = (23)10
Now, 55/23 is 2 with a remainder of 9.
Finally, convert the remainder back into hexadecimal and the decimal 9 is written as 09 in hexadecimal.
Q: 14 P is a 16-bit signed integer. The 2’s complement representation of P is (F87B)16. The 2’s complement representation of 8*P is?
(C3D8)16
(187B)16
(F878)16
(987B)16
[ Option A ]
For signed 2’s complement numbers, multiplication by 8 is done by left shifting the binary representation by 3 bits and keeping only the lower 16 bits. Applying this rule to (F87B)16 gives (C3D8)16.
Q: 15 The result of multiplication of the numbers (10101)2 and (11101)2 in hexadecimal form is?
609
216
261
906
[ Option C ]
To find the result of (10101)2*(11101)2 in hexadecimal form, we first convert both binary numbers into decimal, then multiply them, and finally convert the result into hexadecimal.
| OPERATION | RESULT |
|---|---|
| Binary to Decimal: (10101)2 | 21 |
| Binary to Decimal: (11101)2 | 29 |
| Decimal Multiplication | 21*29 = 609 |
| Hexadecimal Result (After converting 609 into hexadecimal) | 261 |
Q: 16 What is a potential problem of 1’s complement representation of numbers?
Binary sub instructions are not possible
There are two different representations of zero
Multiplication of two numbers cannot be carried out
Binary additions are not possible
[ Option B ]
The main drawback of 1’s complement representation is that it has two different representations of zero, which can lead to confusion and complications in arithmetic operations.
In 1’s complement, a negative number is obtained by inverting all bits of its positive counterpart. Let us consider an 8-bit system.
Positive Zero (+0) : 00000000
Negative Zero (-0) : Take 1’s complement of +0 : 11111111
So, in 1’s complement:
Both represent the same value zero, but they have different binary patterns.
Q: 17 One’s complement representation of (-8)10 is :
(01000)2
(10111)2
(11000)2
(00111)2
[ Option B ]
In one’s complement representation, a negative number is obtained by inverting all the bits of its positive binary form. For (−8)10, we first write +8 in 5-bit binary, which is (01000)2. Now, by inverting each bit (all 0s become 1s and all 1s become 0s), we get (10111)2. Hence, the one’s complement representation of (−8)10 is (10111)2.
Q: 18 The 2’s complement representation of the number (-100)10 in an 8-bit computer is?
10011011
01100100
11100100
10011100
[ Option D ]
To find the 8-bit 2’s complement representation of -100, we follow the standard 2’s complement procedure, step by step.
| OPERATION | RESULT |
|---|---|
| Decimal to Binary (100). | 01100100 |
| 1’s Complement. | 10011011 |
| 2’s Complement (10011011+1) | 10011100 |
Q: 19 Result obtained from subtracting (1001)2 from (1100)2 is:
(1100)2
(0011)2
(0001)2
(1001)2
[ Option B ]
Binary subtraction works similarly to decimal subtraction, with borrowing done in base 2. When we subtract (1001)2 from (1100)2, we first convert them to decimal to understand the operation, 12 minus 9 equals 3. Converting 3 back to binary gives (0011)2. Therefore, the result obtained from subtracting (1001)2 from (1100)2 is (0011)2.
Q: 20 Which of the following is equivalent to decimal 255 in hexadecimal?
EE
FF
F0
FE
[ Option B ]
Q: 21 The sum of 11010 + 01111 equals?
101001
101010
110101
101000
[ Option A ]
While adding binary numbers, addition always starts from the Right Most Bit (LSB) and moves toward the Left Most Bit (MSB), just like in decimal addition.
If a carry remains after adding the MSB, it is written as an extra bit on the left, increasing the length of the result.
Binary Addition: 11010 + 01111
| Bit Position | A (11010) | B (01111) | Carry In | Sum Bit | Carry Out |
|---|---|---|---|---|---|
| 1 (LSB) | 0 | 1 | 0 | 1 | 0 |
| 2 | 1 | 1 | 0 | 0 | 1 |
| 3 | 0 | 1 | 1 | 0 | 1 |
| 4 | 1 | 1 | 1 | 1 | 1 |
| 5 (MSB) | 1 | 0 | 1 | 0 | 1 |
| Final Carry | - | - | - | 1 | - |
Finally, 11010+01111=101001
Q: 22 How many bits are needed to represent decimal number 999 in BCD?
8
12
16
32
[ Option B ]
Q: 23 The binary equivalent of (234.125)10?
(11101010.101)2
(10101010.011)2
(11101010.001)2
(10101110.011)2
[ Option C ]
The binary conversion of integer part (234).
234=128+64+32+8+2 = (234)10=(11101010)2
The binary conversion of fractional part (0.125).
| Fraction*2 | Result | Integer Part |
|---|---|---|
| 0.125*2 | 0.25 | 0 |
| 0.25*2 | 0.5 | 0 |
| 0.5*2 | 1.0 | 1 |
(0.125)10=(0.001)2
Finally, (234.125)10=(11101010.001)2
Q: 24 Which of the following is not a weighted code?
Decimal Number System
Binary Number System
Excess-3 Code
BCD Code
[ Option C ]
A weighted code is a binary code in which each bit position has a fixed weight, and the value of a digit is obtained by adding the weights of the digits.
Q: 25 Subtract (1010)2 from (1101)2 using first complement:
(1100)2
(0101)2
(1001)2
(0011)2
[ Option D ]
Minuend:
Subtrahend:
1’S COMPLEMENT SUBTRACTION METHOD:
In this, the subtrahend is first converted into its 1’s complement and then added to the minuend. If an end-around carry is generated, it is added back to the result. The final sum obtained after adding the carry gives the correct subtraction result.
Given:
Minuend = (1101)2
Subtrahend = (1010)2
Step 1: Take 1’s complement of the subtrahend (1010) = (0101)
Step 2: Add it to the minuend 1101+ 0101 = 10010
Step 3: Add the end-around carry
Therefore, 0010+1 = (0011)2
2’S COMPLEMENT SUBTRACTION METHOD:
In this, the subtrahend is first converted into its 2’s complement and then added to the minuend. If a carry is generated during the addition, it is discarded. The remaining sum obtained after discarding the carry gives the correct subtraction result.
Given:
Minuend = (1101)2
Subtrahend = (1010)2
Step 1: Find 2’s complement of the subtrahend.
Step 2: Add it to the minuend: 1101 + 0110 = 10011
Step 3: Discard the carry, after discarding carry 1 the remaining result = (0011)2
Q: 26 Determine the octal equivalent of (432267)10?
(4322678)8
(346731)8
(2164432)8
None of these
[ Option D ]
(432267)10 = (?)8
To convert a decimal number to octal, repeatedly divide by 8 and note the remainders.
| Division | Quotient | Remainder |
|---|---|---|
| 432267/8 | 54033 | 3 |
| 54033/8 | 6754 | 1 |
| 6754/8 | 844 | 2 |
| 844/8 | 105 | 4 |
| 105/8 | 13 | 1 |
| 13/8 | 1 | 5 |
| 1/8 | 0 | 1 |
Now, read the remainders from bottom to top.
(432267)10=(1514213)8
Q: 27 The answer of the operation (10111)2 * (1110)2 in hexa equivalent is?
150
14C
142
13E
[ Option C ]
To solve the expression (10111)2*(1110)2, we first convert both binary numbers into their decimal equivalents to make the multiplication easy.
(10111)2 = 1*16+0*8+1*4+1*2+1*1 = (23)10
(1110)2 = 1*8+1*4+1*2+0*1 = (14)10
Next, we multiply these two decimal numbers, 23*14 = (322)10. Now, this decimal result must be converted into hexadecimal form.
322/16 = 20 and remainder is 2
20/16 = 1 and remainder is 4
1/16 = 0 and remainder is 1
So, (322)10 = (142)16
Finally, (10111)2*(1110)2 = (142)16
Q: 28 If (146)x + (313)x-2 = (246)8, then the value of base x is –
5
6
7
9
[ Option C ]
To solve this base arithmetic problem, we first understand that numbers in different bases can be converted to decimal (base 10) to simplify calculations. By converting each term to decimal, we can form an algebraic equation in terms of the unknown base x and then solve for it using standard algebraic methods.
Alternatively, since the bases involved are small integers, a trial-and-error method can be used to test reasonable values of x until the sum matches the decimal equivalent of the right-hand side.
Method 1: Algebraic / Decimal Conversion Method:
Convert each number to decimal:
Form the equation in decimal:
(x2 + 4x + 6) + (3x2 − 11x + 13) = 166
4x2 − 7x + 19 = 166
4x2 − 7x − 147 = 0
When solving this quadratic equation, we found value of x is 7.
Method 2: Trial-and-Error
Understand the Base Involved:
Check possible integer values for x:
From the given option 5,6,7,9, try only x=7,9 (because x must be >6), by converting each term to decimal and verify if the sum equals the decimal value of (246)8 (which is 166).
Q: 29 Multiplication of (111)2 by (101)2 is?
(110011)2
(100011)2
(111100)2
(000101)2
[ Option B ]
To solve the expression (111)2*(101)2, we first convert both binary numbers into their decimal equivalents to make the multiplication easy.
(111)2=1*4+1*2+1*1 = 7
(101)2=1*4+0*2+1*1 = 5
Next, we multiply these two decimal numbers, 7*5 = (35)10
Finally, convert (35)10 back into binary, which gives the (100011)2.
Q: 30 With 4-bit 2’s complement arithmetic, which of the following addition will result in overflow?
1111+1101
0110+0110
1101+0101
0101+1011
[ Option B ]
In 2’s complement arithmetic, overflow occurs when:
For a 4-bit 2’s complement system, the representable range is: -8 to +7
In 4-bit 2’s complement representation, the Most Significant Bit (MSB) indicates the sign:
The option (A) is 1111 + 1101
Why is 1111 equal to -1 and 1101 equal to -3 in 4-bit 2’s complement?
Since 1111 and 1101 has MSB = 1, it represents a negative number.
Given number : 1111
Find its magnitude using 2’s complement.
Given number : 1101
Find its magnitude using 2’s complement.
Sum = 1111 + 1101 = (-1+-3) = -4. The sum -4 is within range. So, no overflow occur.
The same procedure is applied for all.
| Option | Binary Addition | Decimal Values | Result (Binary) | Result (Decimal) | Overflow |
|---|---|---|---|---|---|
| (A) | 1111 + 1101 | -1 + (-3) | 1100 | -4 | No |
| (B) | 0110 + 0110 | +6 + +6 | 1100 | -4 | Yes |
| (C) | 1101 + 0101 | -3 + +5 | 0010 | +2 | No |
| (D) | 0101 + 1011 | +5 + (-5) | 0000 | 0 | No |
Q: 31 If (12x)3 = (123)x then the value of x is?
1
2
Either (a) or (b)
None of these
[ Option D ]
Given,
(12x)3=(123)x
The left number is in base 3.
The right number is in base x.
Convert (12x)3 to decimal. In base 3, the positional weights are 32, 31 ,30.
(12x)3 = 1*32+2*31+x*30
(12x)3 = 9+6+x = 15+x
Convert (123)x to decimal. In base x, the positional weights are x2, x1, x0.
(123)x = 1*x2+2*x1+3*x0
(123)x = x2+2x+3
Now the equation is
15+x = x2+2x+3
= x2+x-12=0
= (x+4)(x-3)=0
So, x=-4 or x=3
Now,
So, no valid value of x satisfies the given expression. Therefore, none of these is marked as correct answer.
Q: 32 The smallest integer that can be represented by an 8-bit number in 2’s complement form is?
-256
-128
-127
-255
[ Option B ]
For an n-bit 2’s complement number, the range of representable integers is determined using the formula : -2n-1 to (2n-1-1)
For an 8-bit number : -27 to (27-1) = -128 to 127
Hence, the smallest integer that can be represented is -128.
Q: 33 What is the 8-bits 2’s complement representation of the negative integer -93?
10100011
10100010
0xA2
None of these
[ Option A ]
To find the 8-bit 2’s complement representation of -93, we follow the basic 2’s complement steps.
First, write 93 in binary using 8 bits.
(93)10=(01011101)2
Next, find the 1’s complement by inverting all bits and finally add 1 to 1’s complement.
1’s complement of 01011101 is 10100010.
Finally, 10100010 + 1 = (10100011)2
Q: 34 Suppose we have a 10-bit computer that uses 10-bit into 2’s complement representation. The number representation of -35 is:
0000100011
1100100011
1111011101
1111011011
[ Option C ]
In a 10-bit computer system that uses 2’s complement representation, a negative number is represented by taking the 2’s complement of its positive value.
Write +35 in binary : (35)10=(100011)2
Convert it to 10-bit binary : (35) = (0000100011)
1’s complement : 0000100011 : 1111011100
Add 1 : 1111011100+1 = 1111011101
Finally, (-35)10 = (1111011101)2
Q: 35 8's complement of (7650) is –
0230
0130
1230
3450
[ Option B ]
To compute the 8’s complement of a number, we use the (r−1)’s complement method, where r is the base. First, we find the (r−1)’s complement by subtracting each digit of the number from (r−1), and then we add 1 to the result to get the r’s complement.
For example, consider the octal number (7650)8. Here, the base r=8, so r−1=7. To find the 7’s complement of 7650, we subtract each digit from 7 individually.
Thus, the 7’s complement of (7650)8 is 0127. Next, to obtain the 8’s complement, we add 1 to the 7’s complement, 0127+1= 0130.
Note: The addition is performed according to the base. Here, since it is base 8 (octal), each digit is added modulo 8, and any carry is handled within octal arithmetic.
Q: 36 Which of the following is a valid BCD representation of the decimal number 79?
100 1111
1111 0000
1000 1001
0111 1001
[ Option D ]
Q: 37 The right most bit of the Binary numbers is _______.
LBB
LSB
MBB
MSB
[ Option B ]
The rightmost bit of a binary number is known as the Least Significant Bit (LSB). It represents the smallest value in binary positional notation, corresponding to 20=1.
The opposite is the Most Significant Bit (MSB), which is the leftmost bit and represents the largest value place in the binary number, corresponding to 2n-1.
Q: 38 What is the 2’s complement of the binary number 01010101?
10101011
10101010
10101001
10101100
[ Option A ]
Q: 39 In an 8-bit representation of computer system the decimal number 47 has to subtracted from 38 and result in binary 2’s complement is ___________.
11110111
10001001
11111001
11110001
[ Option A ]
Here 47 is subtracted from 38. So, 38-47 = -9
As we know, negative numbers are stored in 2’s complement form in a computer system. Therefore, we need to represent -9 in 8-bit 2’s complement form.
Step 1: Write the binary equivalent of 9 in 8 bits:
(9)10 = (00001001)2
Step 2: Find the 2’s complement of 00001001:
1’s complement : 11110110
2’s complement : 11110110+1 = 11110111
Hence, the 8-bit 2’s complement representation of -9 is 11110111.
Thank you so much for taking the time to read my Computer Science MCQs section carefully. Your support and interest mean a lot, and I truly appreciate you being part of this journey. Stay connected for more insights and updates! If you'd like to explore more tutorials and insights, check out my YouTube channel.
Don’t forget to subscribe and stay connected for future updates.