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

Friday 7 May 2021

CS1S Computer Systems

COMPSCI1018

1. (a) Convert 1011 1100 to a decimal number, assuming binary representation.

(b) Convert 1011 1100 to a decimal number, assuming two’s complement

(c) Translate the following Sigma16 assembly language to a single line statement in high level language, assuming that y, i are integer variables and x is an array. The data statements for the variables are omitted for simplicity. Just identify the         calculation performed and present it in a single statement.

load   R1,i[R0]

load   R2,x[R1]

lea    R3,35[R0]

div    R4,R2,R3

(d) Give a detailed account of the sequence of steps performed by the processor as it executes the instruction:  store R3,z[R4]

(e) Computer architectures today are mostly 64-bit: give two potential benefits.

(f) There is an array named x that contains n integers, where n is an integer variable

in memory. Write a Sigma16 assembly language program that creates another     array y of length n which contains all the elements of array x but changes them to positive (take care to handle negative numbers and store as positive). The            program must work correctly for any n and initial array ofelements. You may     assume that the variables have been declared but not initialised. Your program    should exit cleanly.

2. (a) Define the behaviour of a demultiplexer (the demux1 circuit), given the control   input c and the data input d. Give a circuit that implements a demultiplexer using logic gates.

(b) Explain what the levels of abstraction of a computer system are. Include a

diagram representing them.

(c) Given the following assembly program:

load R2,x[R0]

load R3,y[R0]

add R1,R2,R3

store R1,y[R0]

trap R0,R0,R0

y data 40

Show the content of the memory using three columns for each memory location to indicate: 1) address (four hex values); 2) contents; 3) what the contents mean.

(d) Consider a doubly linked ordered list where p is a pointer to a node in the list (not the header) and each node is a record consisting of three words: an integer            value, a pointer to the previous node in the list prev, and a pointer to the next  node in the list next. Note that the value of the header node is 0, the last node in the list has nil in the next field (nil is represented by 0), and the value of each node is greater than the prev node but less than the next node. The following   program deletes the node whose value is equal to the input variable x (assume   that x ≠ 0 and there is a node that meets this condition). Translate the program to  Sigma16 assembly language. You don’t need to write out the low level language  version, and you don’t need to define the variables or the linked list.

; given p = pointer to list, x = value to delete while (*p).value /= x do

if (*p).value < x

p := (*p).next

else

p := (*p).prev

q := (*p).prev;

(q*).next := (*p).next;

(e) Identify three different causes of interrupts in a computer system and give an example for each case.