Ch 04: Bit Manipulation and Shifts

198 Questions198 MCQs0 Short Questions0 Long Questions
๐ŸŽฏ Exam Practice Papers
SEMESTER PASS

CS401 - Computer Architecture and Assembly Language Programming Examination Practice

Timed practice exam simulation for CS401 - Computer Architecture and Assembly Language Programming.

๐Ÿ“˜ VU MID TERM EXAMLectures 1 to 22
โฑ๏ธ 60 Mins

Mid Term Examination

Covers syllabus of Lectures 1 to 22 with 30 high-yield MCQs in a timed exam environment.

๐Ÿ“30 MCQs
โฑ๏ธ60 Minutes
๐Ÿ“— VU FINAL TERM EXAMLectures 23 to 45
โฑ๏ธ 90 Mins

Final Term Examination

Comprehensive semester exam preparation with 45 MCQs covering Lectures 23 to 45 with complete course coverage.

๐Ÿ“45 MCQs
โฑ๏ธ90 Minutes
Showing 171 โ€“ 180 of 198 Questions
Page 18 of 20
Q171
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 4๐Ÿท๏ธ 4.1. Shift InstructionsEasy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
After the execution of the SAR (Shift Arithmetic Right) instruction, what happens to the Most Significant Bit (MSB / sign bit)?
๐Ÿ’ป assembly Snippet
sar ax, 1  ; MSB sign bit is replicated
  1. A.The MSB is replaced by 0
  2. B.The MSB is replaced by 1
  3. C.The MSB retains its original value (sign bit replicated)
  4. D.The MSB is replaced by the value of the Carry Flag
Q172
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 4๐Ÿท๏ธ 4.2. Shifting and RotationsEasy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
When executing a Rotate Through Carry Right (RCR) instruction on a 16-bit word operand, how many total bits form the circular shift ring?
๐Ÿ’ป assembly Snippet
rcr ax, 1  ; Rotates 16-bit AX + 1-bit CF (17 bits total)
  1. A.16 bits rotation
  2. B.1 bit rotation
  3. C.17 bits rotation
  4. D.8 bits rotation
Q173
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 4๐Ÿท๏ธ 4.1. Shift InstructionsEasy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
Suppose decimal number 35 is shifted 2 bits to the left in binary. What does its new decimal value become?
๐Ÿ’ป assembly Snippet
mov al, 35   ; AL = 00100011b
shl al, 2    ; AL = 10001100b (140 decimal)
  1. A.35
  2. B.70
  3. C.140
  4. D.17
Q174
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 4๐Ÿท๏ธ 4.1. Shift InstructionsEasy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
The bit-shifting operation diagram `| 0 | ---> [ 1 1 0 1 0 0 0 ] ---> [ C ]` (where 0 enters from the left into the MSB and the LSB exits into the Carry Flag) illustrates which instruction?
๐Ÿ’ป assembly Snippet
shr ax, 1
  1. A.SHL (Shift Logical Left)
  2. B.SAR (Shift Arithmetic Right)
  3. C.SHR (Shift Logical Right)
  4. D.SAL (Shift Arithmetic Left)
Q175
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 4๐Ÿท๏ธ 4.1. Shift InstructionsEasy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
The bit-shifting operation diagram `[ C ] <--- [ 1 1 0 1 0 0 0 ] <--- | 0 |` (where 0 enters from the right into the LSB and the MSB exits into the Carry Flag) illustrates which instruction?
๐Ÿ’ป assembly Snippet
shl ax, 1
  1. A.SHL (Shift Logical Left)
  2. B.SAR (Shift Arithmetic Right)
  3. C.SHR (Shift Logical Right)
  4. D.SAL (Shift Arithmetic Left)
Q176
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 4๐Ÿท๏ธ 4.1. Extended Precision OperationsEasy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
Numbers of arbitrary bit size (extended precision) can be added using a proper combination of which instructions?
๐Ÿ’ป assembly Snippet
add ax, cx  ; Add lower 16 bits
adc bx, dx  ; Add higher 16 bits with carry
  1. A.ADD and ADC
  2. B.ABD and ADC
  3. C.ADC and ADC
  4. D.None of the given options
Q177
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 4๐Ÿท๏ธ 4.1. Extended Precision OperationsEasy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
Analogous to addition with carry (ADC), which assembly instruction performs subtraction while factoring in an incoming borrow?
๐Ÿ’ป assembly Snippet
sub ax, cx  ; Subtract lower 16 bits
sbb bx, dx  ; Subtract higher 16 bits with borrow
  1. A.SWB
  2. B.SBB (Subtract with Borrow)
  3. C.SUB
  4. D.SBC
Q178
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 4๐Ÿท๏ธ 4.1. Bitwise Logic OperationsEasy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
When executing the instruction 'AND AX, BX', how many individual single-bit bitwise AND operations are performed simultaneously across the 16-bit registers?
๐Ÿ’ป assembly Snippet
and ax, bx  ; Performs 16 parallel 1-bit AND operations
  1. A.16 bitwise AND operations
  2. B.17 bitwise AND operations
  3. C.32 bitwise AND operations
  4. D.8 bitwise AND operations
Q179
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 4๐Ÿท๏ธ 4.1. Bitwise Logic OperationsEasy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
Which bitwise logical instruction is used with a bitmask to test or check whether specific bits of an operand are set (1) or cleared (0)?
๐Ÿ’ป assembly Snippet
and ax, 0x0001  ; Test if bit 0 is set
  1. A.AND
  2. B.OR
  3. C.XOR
  4. D.NOT
Q180
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 4๐Ÿท๏ธ 4.1. Bitwise Logic OperationsEasy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
What are the four primary selective bit masking operations performed using bitwise logical instructions?
  1. A.Clearing, XOR, Inversion, and Testing
  2. B.Clearing, Setting, Inversion, and Testing
  3. C.Clearing, XOR, AND, and Testing
  4. D.None of the given options