1.
One of the shortcomings of the “signed magnitude” method of representing negativenumbers in binary code is:
Correct Answer
E. Both a and d
Explanation
The "signed magnitude" method of representing negative numbers in binary code has two shortcomings. Firstly, there are two codes for the number zero, which can lead to confusion and ambiguity. Secondly, the operation of addition requires complex rules, making calculations more complicated. Therefore, both options a and d are correct as they highlight these shortcomings.
2.
What is the representation of the (decimal) number –1 in 4 bit 1’s complement format?
Correct Answer
D. 1110
Explanation
The representation of the decimal number -1 in 4-bit 1's complement format is 1110. In 1's complement, negative numbers are represented by inverting all the bits of the positive number. Since 1 is represented as 0001 in 4-bit format, to represent -1, we need to invert all the bits, resulting in 1110.
3.
The total number of items representable by a 4 byte binary word (using conventionalabbreviations) is:
Correct Answer
B. 4G
Explanation
A 4 byte binary word can represent 2^32 different combinations. Since there are 8 bits in a byte, each bit can represent 2 different values (0 or 1). Therefore, 2^32 is equal to 4G, which means a 4 byte binary word can represent 4 gigabytes worth of different items.
4.
Using two's complement encoding, subtract 11100 from 01101, and report the result as a5-bit two's complement binary number
Correct Answer
E. 10001
Explanation
To subtract 11100 from 01101 using two's complement encoding, we first need to find the two's complement of 11100. In two's complement, we invert all the bits of the number and add 1 to the result. The two's complement of 11100 is 00100.
Next, we add the two numbers - 01101 and 00100. The sum is 10001.
Since the question asks for the result as a 5-bit two's complement binary number, we keep the leftmost 5 bits and discard the rest. Therefore, the final answer is 10001.
5.
Convert the 8-bit two's complement number 10001111 into decimal.
Correct Answer
B. -113
Explanation
To convert an 8-bit two's complement number into decimal, we first check the most significant bit (MSB), which in this case is 1. Since the MSB is 1, this indicates that the number is negative. Next, we invert all the bits and add 1 to find the magnitude. Inverting the bits gives us 01110000. Adding 1 gives us 01110001. Finally, we convert this binary number into decimal, which is -113.
6.
Assembly Language instruction sets can be categorized into three basic types ofinstruction:
Correct Answer
A. Operations, Data Movement and Control
Explanation
Assembly Language instruction sets can be categorized into three basic types of instruction: Operations, Data Movement, and Control.
Operations instructions are used to perform mathematical and logical operations on data. They include instructions such as addition, subtraction, multiplication, and division.
Data Movement instructions are used to move data between different memory locations or between memory and registers. They include instructions such as load, store, move, and exchange.
Control instructions are used to control the flow of execution in a program. They include instructions such as jump, branch, and subroutine call.
These three types of instructions form the foundation of assembly language programming and allow for the manipulation of data and control of program flow.
7.
A label in assembly language code is:
Correct Answer
B. A symbolic representation of a memory location
Explanation
A label in assembly language code is a symbolic representation of a memory location. It is used to mark a specific point in the code and can be referred to by the programmer or the assembler to access or manipulate the data stored at that memory location. Labels provide a way to organize and navigate the code, making it easier to understand and maintain. They are not just abbreviations for instructions or temporary names for variables, but rather serve as important references within the code.