Student Solution

-->

"Education is the most powerful weapon which you can use to change the world”
– Nelson Mandela

1 University

1 Course

1 Subject

Logical Operations 1

Logical Operations 1

Q Question 1 1 / 1 pts Complete the following statements by selecting the most appropriate answer from the dropdown. i. Masking ON performs logical OR operation, while masking OFF performs logical ["", "", "", "", "", ""] . ii. When forcing a bit position to hold 0, we use masking ["", ""] operation; when forcing a bit position to hold 1, we use masking ON operation. Question 2 1.2 / 3 pts Consider the following 8-bit registers. Evaluate the logical expression at the bottom. • a = 0x6B • b = 0x99 • c = 0xE1 Fill the table with the binary equivalent of the expressions in the far-left column. Position 7 down to 4 3 down to 0 a = b = c = b & c = a | (b & c) = c << 2 = Final result (a | (b & c)) XOR (c << 2) = 0x (No need to use 0x) Question 3 0.5 / 3 pts Consider the following sets of secret operations. For each set of operations, determine if they are masking ON or masking OFF, and determine the masking pattern for each set of operations. • Note that each set of operations contains TWO groups of input and output patterns. • Use the TWO groups of input and output patterns to determine the masking pattern used in this set. • When fill the masking pattern, use x (lower-case English letter) to indicate a bit can be either 0 or 1. See the following example. o 1x01 means both 1101 and 1001 can be used as the masking pattern, o 11xx mean the masking pattern can be one of 1100, 1101, 1110, and 1111. Set i. Position 7 down to 4 3 down to 0 Group #1 Input 0101 1001 Group #1 Output 0001 1000 Group #2 Input 1011 1011 Group #2 Output 1011 1010 Mask Set ii. Position 7 down to 4 3 down to 0 Group #1 Input 0011 1011 Group #1 Output 0011 1111 Group #2 Input 1001 1100 Group #2 Output 1011 1110 Mask Question 4 1.5 / 3 pts For each requirement below, choose an appropriate masking operation and give the most accurate 32-bit masking pattern in hexadecimal representation (write in groups of 4 digits). • See the Sample row as an example. Requirement Masking on/off (fill on or off) Masking Pattern Sample Preserve the bit at position 0 while forcing 0s at all other positions. off 0x0000 0001 i. Preserve the bits at positions 31 ~ 6 while forcing 1s at all other positions. ii. Preserve the bit at position 31 while forcing 0s at all other positions. iii. Preserve the bits at even positions (0, 2, 4, ...) while forcing 1s at all other positions.

View Related Questions

Solution Preview

Answer 1: Correct! OR Answer 2: Correct! AND Answer 3: Correct! OFF Answer 4: Correct! ON