Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

COMPSCI210

SECOND SEMESTER, 2019

TEST

Computer Systems 1

Question 1

[1.5 marks] Convert 12.C16 to a decimal value.

(a)  12.87510

(b) 18.62510

(c)  18.7510

(d) 12.62510

(e)  12.510

Question 2

[1.5 marks] What is the decimal value of 1001012 which is a 6-bit two’s complement representation?

(a) -2710

(b) 3510

(c) 2710

(d) -3310

(e) -4510

Question 3

[1.5 marks] Which of the following logic expressions give result 0 and 1 respectively? 

(a) 0 + (1 × 1) and  1 × (0 ⊕ 1)

(b) 0 + (1 × 1) and  1 × (1 ⊕ 1)

(c) 0 + (0 × 1) and  0 × (0 ⊕ 1)

(d) 0 + (0 × 1) and  1 × (1 ⊕ 1)

(e) 0 + (0 × 1) and  1 × (0 ⊕ 1)

Question 4

[1.5 marks] Based on the lock state diagram, what is the next state if the current state is D and R-13 is executed?

 

(a) B

(b) D

(c) A

(d) C

(e) None of the above

Question 5

[1.5 marks] What is the ASCII character with the value C’ + 4?

(a) F

(b) ‘g’

(c) ‘f’

(d) ‘h’

(e) ‘G’

Question 6

[1.5 marks] Given that the inputs (I and S) and the outputs (Y) of the 8-to-1 multiplexer are I(7:0), S(2:0) and Y respectively. What should be Y if S is 1012?

(a) I(5)

(b) I(6)

(c) I(4)

(d) I(1)

(e) I(7)

Question 7

[1.5 marks] What is the binary representation for -1.510 using the IEEE 754 floating point format?"

(a)  1 01111111 110000000000000000000002

(b) 1 10000000 100000000000000000000002

(c)  1 10000000 111000000000000000000002

(d) 1 01111111 100000000000000000000002

(e)  1 01111111 111000000000000000000002

Question 8

[1.5 marks] According to the below memory architecture, which cell should be selected if the address is “10012”?

 

(a) Cell 8

(b) Cell 9

(c) Cell 10

(d) Cell 6

(e) Cell 13

Question 9

[1.5 marks] Which one is the characteristic of register compared to memory?

(a) Can be accessed simultaneously

(b) Slower

(c) Read-only

(d) Smaller area per data-bit

(e) One address can be accessed at a time

Question 10

[1.5 marks] What is the meaning of the directive ".ORIG"?

(a) Allocate a few initialized characters and a null terminator for that label

(b) Allocate a word of storage for that label with an initialized value

(c) Define the starting address of the program

(d) Allocate a few words of storage for that label (e) Indicate that it is the end of the program

Question 11

[1.5 marks] What is the meaning of the following LC3 instruction?

STI R2, -4

(a) Mem[Mem[PC + sign-extended(-4)]]  R2

(b) Mem[PC + sign-extended(-4)]  R2

(c) Mem[R2]  PC + sign-extended(-4)

(d) R2  Mem[PC + sign-extended(-4)]

(e) R2  Mem[Mem[PC + sign-extended(-4)]]

Question 12

[1.5 marks] What is the meaning of the following LC3 instruction?

LEA R0, -8

(a) PC  R0 + sign-extended(-8)

(b) R0  PC + 8

(c) PC  Mem[R0 + sign-extended(-8)]

(d) R0  Mem[PC + sign-extended(-8)]

(e) R0  PC + sign-extended(-8)

The LC3 program below is used for the following 3 questions.

 

 

 

; The inner ;

AGAIN

 

;

;

NUMBER

SIX

.ORIG LD

LD

AND

loop

ADD

ADD

BRzp

HALT

.BLKW .FILL .END

x3000

R1, SIX

R2, NUMBER

R3, R3, #0

 

R3, R3, R2

R1, R1, #-2

AGAIN

 

2

x0006

Question 13

[2 marks] What is the address of label SIX”?

(a) 0x3008

(b) 0x3009

(c) 0x3010

(d) 0x3000

(e) 0x300A

Question 14

[2 marks] What is the meaning of the instruction LD R2, NUMBER”?

(a) R2  Mem[x3008]

(b) R2  Mem[x3006]

(c) R2  Mem[x3007]

(d) R2  x3008

(e) R2  x3007

Question 15

[2 marks] What is the function of the whole program?

(a) Mem[NUMBER] x 3

(b) Mem[NUMBER x 3]

(c) Mem[NUMBER] + 3

(d) Mem[NUMBER x 4]

(e) Mem[NUMBER] x 4

The LC3 program below is used for the following 2 questions.

.ORIG

AND

LD

ADD

JSR

ADD

ADD

JSR

ADD

JSR

ADD

JSR

ADD

x3000

R0, R0, #0

R6, EMPTY

R1, R0, #0

Push

R0, R0, #5 R1, R0, #0 Push

R0, R0, #7 Pop

R0, R1, #0 Pop

R0, R1, #0 EXIT

R1, R6, #0 R6, R6, #-1

R6, R6, #1 R1, R6, #0

x4000

x25

; First Push

 

; Second Push

Push

 

Pop

 

EMPTY EXIT

BRnzp

STR

ADD

RET

ADD

LDR

RET

.FILL TRAP .END

 

 

 

 

 

 

; Halt

Question 16

[2 marks] What is the value of R6 before the execution of the instruction ADD R0, R0, 7” (after the second Push)?

(a) 0x4001

(b) 0x3FFD

(c) 0x4000

(d) 0x3FFF

(e) 0x3FFE

Question 17

[2 marks] What is the value of R7 before the execution of the instruction ADD R0, R0, 7” (after the second Push)?

(a) 0x3006

(b) 0x3007

(c) 0x300A

(d) 0x3008

(e) 0x3009

The LC3 sub-routine below is used for the following 5 questions. You can assume that the stack sub- routines (Push and Pop) are well written.


Question 18

[2 marks] What is the value of the machine code of the instruction with LABEL C”?

(a) 0x480A

(b) 0x4810

(c) 0x4809

(d) 0x4811

(e) 0x4808

Question 19

[2 marks] What is the value of the machine code of the instruction with “LABEL A”?

(a) 0x0FF9

(b) 0x0FF8

(c) 0x0010

(d) 0x0FFA

(e) 0x0009

Question 20

[2 marks] What is the value of the machine code of the instruction with “LABEL B”?

(a) 0x0C02

(b) 0x0C04

(c) 0x0803

(d) 0x0C03

(e) 0x0804

Question 21

[3 marks] What is the value printed at the console if the value in R3 is 72010?

(a) 714

(b) 240

(c) 24A

(d) 2D0

(e) 720

Question 22

[3 marks] What is the value printed at the console if the value in R3 is 12010?

(a)  120

(b) 080

(c) 078

(d) 104

(e) 072