Knowee
Questions
Features
Study Tools

NOT 1    0    0    1 DST SRC 1 1    1    1    1    1 R[DST] ← NOT(R[SRC])ADD 0    0    0    1 DST SRC1 0 0    0 SRC2 R[DST] ← R[SRC1] + R[SRC2]AND 0    1    0    1 DST SRC1 0 0    0 SRC2 R[DST] ← R[SRC1] & R[SRC2]ADD 0    0    0    1 DST SRC 1 Immediate R[DST] ← R[SRC] + SEXT(Immediate)AND 0    1    0    1 DST SRC 1 Immediate R[DST] ← R[SRC] & SEXT(Immediate)LDR 0    1    1    0 DST BASE Offset R[DST] ← M[R[BASE]+SEXT(Offset)]STR 0    1    1    1 SRC BASE Offset M[R[BASE]+SEXT(Offset)] ← R[SRC]LD 0    0    1    0 DST PC Offset R[DST] ← M[inc(PC)+SEXT(PCOffset)]ST 0    0    1    1 SRC PC Offset M[inc(PC)+SEXT(PCOffset)] ← R[SRC]LDI 1    0    1    0 DST PC Offset R[DST] ← M[M[inc(PC)+SEXT(PCOffset)]]STI 1    0    1    1 SRC PC Offset M[M[inc(PC)+SEXT(PCOffset)]] ← R[SRC]LEA 1    1    1    0 DST PC Offset R[DST] ← inc(PC)+SEXT(PCOffset)BR 0    0    0    0 N Z P PC Offset PC ← inc(PC)+SEXT(PCOffset) if condition is trueelse PC ← inc(PC),  see Note 3 below.JMP 1    1    0    0 0    0    0 BASE 0    0    0    0    0    0 PC ← R[BASE]TRAP 1    1    1    1 0    0    0    0 Trap Vector jump to trap vector, see Note 4 below.UNUSED 1    1    0    1 invalid instructionNotes:BASE, SRC, SRC1, SRC2, DST are 3-bit register designations that access the Register File, R[...]Immediate (5), Offset (6), PC Offset (9) are N-bit 2's complement integers, where N is given in ()'sCondition Codesare set by ADD, AND, NOT, LD, LDR, LDI, LEAare used by BR based on the most recent instruction to set CCTrap Vector is an 8-bit value that is used to call an OS service routine:0x21 output a character0x23 input a character0x25 halt the program Flag question: Question 3Question 310 ptsAssume the following shows the contents of memory locations:ADDRESS CONTENTS0x3020 0000 0000 0000 01010x3021 0000 0000 0000 10100x3022 0000 0000 0000 01000x3023 0000 0000 0000 10110x3024 0000 0000 0000 00110x3025 0000 0000 0000 1100The machine program below adds some of the integers in the memory shown above. Which ones and in what order depends on the details of the machine instructions.0x3000 1110 001 0000111110x3001 0101 011 011 1 000000x3002 0101 010 010 1 000000x3003 0001 010 010 1 000110x3004 0000 010 0000001010x3005 0110 100 001 0000010x3006 0001 011 011 0 00 1000x3007 0001 001 001 1 000010x3008 0001 010 010 1 111110x3009 0000 111 1111110100x300A 1111 0000 0010 0101Your task is to carefully trace the execution of the machine instructions above to determine the consecutive changes to R3.(Enter your 16-bit answers in hex like the following example: 0x2A3F)A.)   What is the first value assigned to R3 by the instructions above?  B.)   What is the second value assigned to R3 by the instructions above? C.)   What is the third value assigned to R3 by the instructions above? D.)   What is the fourth value assigned to R3 by the instructions above?

Question

NOT 1    0    0    1 DST SRC 1 1    1    1    1    1 R[DST] ← NOT(R[SRC])ADD 0    0    0    1 DST SRC1 0 0    0 SRC2 R[DST] ← R[SRC1] + R[SRC2]AND 0    1    0    1 DST SRC1 0 0    0 SRC2 R[DST] ← R[SRC1] & R[SRC2]ADD 0    0    0    1 DST SRC 1 Immediate R[DST] ← R[SRC] + SEXT(Immediate)AND 0    1    0    1 DST SRC 1 Immediate R[DST] ← R[SRC] & SEXT(Immediate)LDR 0    1    1    0 DST BASE Offset R[DST] ← M[R[BASE]+SEXT(Offset)]STR 0    1    1    1 SRC BASE Offset M[R[BASE]+SEXT(Offset)] ← R[SRC]LD 0    0    1    0 DST PC Offset R[DST] ← M[inc(PC)+SEXT(PCOffset)]ST 0    0    1    1 SRC PC Offset M[inc(PC)+SEXT(PCOffset)] ← R[SRC]LDI 1    0    1    0 DST PC Offset R[DST] ← M[M[inc(PC)+SEXT(PCOffset)]]STI 1    0    1    1 SRC PC Offset M[M[inc(PC)+SEXT(PCOffset)]] ← R[SRC]LEA 1    1    1    0 DST PC Offset R[DST] ← inc(PC)+SEXT(PCOffset)BR 0    0    0    0 N Z P PC Offset PC ← inc(PC)+SEXT(PCOffset) if condition is trueelse PC ← inc(PC),  see Note 3 below.JMP 1    1    0    0 0    0    0 BASE 0    0    0    0    0    0 PC ← R[BASE]TRAP 1    1    1    1 0    0    0    0 Trap Vector jump to trap vector, see Note 4 below.UNUSED 1    1    0    1 invalid instructionNotes:BASE, SRC, SRC1, SRC2, DST are 3-bit register designations that access the Register File, R[...]Immediate (5), Offset (6), PC Offset (9) are N-bit 2's complement integers, where N is given in ()'sCondition Codesare set by ADD, AND, NOT, LD, LDR, LDI, LEAare used by BR based on the most recent instruction to set CCTrap Vector is an 8-bit value that is used to call an OS service routine:0x21 output a character0x23 input a character0x25 halt the program Flag question: Question 3Question 310 ptsAssume the following shows the contents of memory locations:ADDRESS CONTENTS0x3020 0000 0000 0000 01010x3021 0000 0000 0000 10100x3022 0000 0000 0000 01000x3023 0000 0000 0000 10110x3024 0000 0000 0000 00110x3025 0000 0000 0000 1100The machine program below adds some of the integers in the memory shown above. Which ones and in what order depends on the details of the machine instructions.0x3000 1110 001 0000111110x3001 0101 011 011 1 000000x3002 0101 010 010 1 000000x3003 0001 010 010 1 000110x3004 0000 010 0000001010x3005 0110 100 001 0000010x3006 0001 011 011 0 00 1000x3007 0001 001 001 1 000010x3008 0001 010 010 1 111110x3009 0000 111 1111110100x300A 1111 0000 0010 0101Your task is to carefully trace the execution of the machine instructions above to determine the consecutive changes to R3.(Enter your 16-bit answers in hex like the following example: 0x2A3F)A.)   What is the first value assigned to R3 by the instructions above?  B.)   What is the second value assigned to R3 by the instructions above? C.)   What is the third value assigned to R3 by the instructions above? D.)   What is the fourth value assigned to R3 by the instructions above?

...expand
🧐 Not the exact question you are looking for?Go ask a question

Solution

This question is asking you to trace the execution of a series of machine instructions in a hypothetical computer system. The instructions are given in binary and hexadecimal formats, and the task is to determine the changes to a specific register (R3) as the instructions are executed.

Here's how you can approach this:

  1. Identify the instruction set architecture (ISA) for the machine. The question provides a table of instructions, which includes operation codes (opcodes), operand specifiers, and the effects of each instruction.

  2. Translate the machine instructions from binary or hexadecimal into the corresponding operations from the ISA. This will give you a sequence of operations that the machine will perform.

  3. Execute the operations in order, keeping track of the changes to R3.

  4. The first four changes to R3 are the answers to parts A, B, C, and D of the question.

Without more specific information about the ISA and the binary/hexadecimal representations of the instructions, it's not possible to provide the exact answers. However, this is the general approach you would take to solve this kind of problem.

This problem has been solved

Similar Questions

NOT 1    0    0    1 DST SRC 1 1    1    1    1    1 R[DST] ← NOT(R[SRC])ADD 0    0    0    1 DST SRC1 0 0    0 SRC2 R[DST] ← R[SRC1] + R[SRC2]AND 0    1    0    1 DST SRC1 0 0    0 SRC2 R[DST] ← R[SRC1] & R[SRC2]ADD 0    0    0    1 DST SRC 1 Immediate R[DST] ← R[SRC] + SEXT(Immediate)AND 0    1    0    1 DST SRC 1 Immediate R[DST] ← R[SRC] & SEXT(Immediate)LDR 0    1    1    0 DST BASE Offset R[DST] ← M[R[BASE]+SEXT(Offset)]STR 0    1    1    1 SRC BASE Offset M[R[BASE]+SEXT(Offset)] ← R[SRC]LD 0    0    1    0 DST PC Offset R[DST] ← M[inc(PC)+SEXT(PCOffset)]ST 0    0    1    1 SRC PC Offset M[inc(PC)+SEXT(PCOffset)] ← R[SRC]LDI 1    0    1    0 DST PC Offset R[DST] ← M[M[inc(PC)+SEXT(PCOffset)]]STI 1    0    1    1 SRC PC Offset M[M[inc(PC)+SEXT(PCOffset)]] ← R[SRC]LEA 1    1    1    0 DST PC Offset R[DST] ← inc(PC)+SEXT(PCOffset)BR 0    0    0    0 N Z P PC Offset PC ← inc(PC)+SEXT(PCOffset) if condition is trueelse PC ← inc(PC),  see Note 3 below.JMP 1    1    0    0 0    0    0 BASE 0    0    0    0    0    0 PC ← R[BASE]TRAP 1    1    1    1 0    0    0    0 Trap Vector jump to trap vector, see Note 4 below.UNUSED 1    1    0    1 invalid instructionNotes:BASE, SRC, SRC1, SRC2, DST are 3-bit register designations that access the Register File, R[...]Immediate (5), Offset (6), PC Offset (9) are N-bit 2's complement integers, where N is given in ()'sCondition Codesare set by ADD, AND, NOT, LD, LDR, LDI, LEAare used by BR based on the most recent instruction to set CCTrap Vector is an 8-bit value that is used to call an OS service routine:0x21 output a character0x23 input a character0x25 halt the program Flag question: Question 3Question 310 ptsAssume the following shows the contents of memory locations:ADDRESS CONTENTS0x3020 0000 0000 0000 01010x3021 0000 0000 0000 10100x3022 0000 0000 0000 01000x3023 0000 0000 0000 10110x3024 0000 0000 0000 00110x3025 0000 0000 0000 1100The machine program below adds some of the integers in the memory shown above. Which ones and in what order depends on the details of the machine instructions.0x3000 1110 001 0000111110x3001 0101 011 011 1 000000x3002 0101 010 010 1 000000x3003 0001 010 010 1 000110x3004 0000 010 0000001010x3005 0110 100 001 0000010x3006 0001 011 011 0 00 1000x3007 0001 001 001 1 000010x3008 0001 010 010 1 111110x3009 0000 111 1111110100x300A 1111 0000 0010 0101Your task is to carefully trace the execution of the machine instructions above to determine the consecutive changes to R3.(Enter your 16-bit answers in hex like the following example: 0x2A3F)A.)   What is the first value assigned to R3 by the instructions above?  B.)   What is the second value assigned to R3 by the instructions above? C.)   What is the third value assigned to R3 by the instructions above? D.)   What is the fourth value assigned to R3 by the instructions above?

Table of LC-3 Instructions:15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 SEMANTICSNOT 1    0    0    1 DST SRC 1 1    1    1    1    1 R[DST] ← NOT(R[SRC])ADD 0    0    0    1 DST SRC1 0 0    0 SRC2 R[DST] ← R[SRC1] + R[SRC2]AND 0    1    0    1 DST SRC1 0 0    0 SRC2 R[DST] ← R[SRC1] & R[SRC2]ADD 0    0    0    1 DST SRC 1 Immediate R[DST] ← R[SRC] + SEXT(Immediate)AND 0    1    0    1 DST SRC 1 Immediate R[DST] ← R[SRC] & SEXT(Immediate)LDR 0    1    1    0 DST BASE Offset R[DST] ← M[R[BASE]+SEXT(Offset)]STR 0    1    1    1 SRC BASE Offset M[R[BASE]+SEXT(Offset)] ← R[SRC]LD 0    0    1    0 DST PC Offset R[DST] ← M[inc(PC)+SEXT(PCOffset)]ST 0    0    1    1 SRC PC Offset M[inc(PC)+SEXT(PCOffset)] ← R[SRC]LDI 1    0    1    0 DST PC Offset R[DST] ← M[M[inc(PC)+SEXT(PCOffset)]]STI 1    0    1    1 SRC PC Offset M[M[inc(PC)+SEXT(PCOffset)]] ← R[SRC]LEA 1    1    1    0 DST PC Offset R[DST] ← inc(PC)+SEXT(PCOffset)BR 0    0    0    0 N Z P PC Offset PC ← inc(PC)+SEXT(PCOffset) if condition is trueelse PC ← inc(PC),  see Note 3 below.JMP 1    1    0    0 0    0    0 BASE 0    0    0    0    0    0 PC ← R[BASE]TRAP 1    1    1    1 0    0    0    0 Trap Vector jump to trap vector, see Note 4 below.UNUSED 1    1    0    1 invalid instructionNotes:BASE, SRC, SRC1, SRC2, DST are 3-bit register designations that access the Register File, R[...]Immediate (5), Offset (6), PC Offset (9) are N-bit 2's complement integers, where N is given in ()'sCondition Codesare set by ADD, AND, NOT, LD, LDR, LDI, LEAare used by BR based on the most recent instruction to set CCTrap Vector is an 8-bit value that is used to call an OS service routine:0x21 output a character0x23 input a character0x25 halt the program Flag question: Question 1Question 18 ptsAssume the following shows the initial contents of the specified registers:REGISTER CONTENTSR1 0000 0000 0000 1001R2 0000 0000 0000 0101R3 0000 0000 0000 0010Also assume the following LC-3 machine instructions are loaded into memory at addresses shown:0x4000 1001 001 011 1 111110x4001 0001 001 001 1 000010x4002 0001 011 010 0 00 0010x4003 0000 001 001010000After the code above completes execution, what is the final value in each register below?(Enter your 16-bit answer in hex like the following example: 0x2A3F)A.)   R1?  B.)   R2?  C.)   R3?  D.)   PC?

R1 = 0b1111, R2 = 0b0101 BIC R0, R1, R2  *1 pointR0 = 0b1010R0 = 0b1111R0 = 0b0101R0 = 0b1100

R1 ←R2 denotes*1 pointContents of R1 is tranfered to R2Contents of R2 is tranfered to R1Both of aboveNone of above

onsider T = [1 0 0; 0 1 0; 0 0 1; 1 1 1]. What is the output of the following command?    transpose(T)Question 10Select one:a.[1  1  1;  0  0  1;  0  1  0;  0  0  1]b.[1  1  0  0;  1  0  1  0;  1  0  0  1]c.[0  0  1;  0  1  0;  1  0  0;  1  1  1]d.[1  0  0  1;  0  1  0  1;  0  0  1  1]

1/1

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.