﻿ C/C++ - 硕博编程辅导/课程/代码/程序/it/cs/code/java/python/c/c++/人工智能/深度学习/R/算法/web/app/assignment辅导|原创|加急|硕士|博士|985高校|欧洲美国常青藤名校

# 北美代写,Homework代写,Essay代寫-准时✔️高质✔最【靠谱】

Thursday 10 December 2020 Expected Duration: 90 minutes Start time: 14:00 Time Allowed: 3 hours

Tuesday 30 April 2019 9:30 am – 10:30 am (Duration: 1 hour) DEGREES of MSci, MEng, BEng, BSc, MA and MA (Social Sciences) Computing Science 1S (Answer All Questions) This examination paper is worth a total of 50 marks

1. (a) Convert 1100 0011 to a decimal number, assuming binary representation.  (b) Convert 1100 0011 to a decimal number, assuming two’s complement representation.  (c) Translate the statement a := b*c – d/b into Sigma16 assembly language, assuming that a, b, c, and d are integer variables. You do not need to write a complete program, and you don’t need to write data statements for the variables. Just translate this one statement.  (d) In the following program, variables k, i and n are integers, and x is an array of signed integers containing n elements. Suppose the program is executed with these initial values: n = 7 x = [9, -2, 13, 0, 45, -8, 7] After the program executes, what are the values of k and x? k := 0; for i := 0 to n-1 do { if x[i] < 0 then { x[i] := -x[i]; } else { k := k+1; } }  (e) Translate the program in part (d) into low level language. You do not need to define the variables or array, just translate the program code. (The low level language contains assignment statements, goto statements, and statements of the form if b then goto label, where b is a Boolean expression.)  (f) Translate the low level program in part (e) into a complete program in Sigma16 assembly language. Use data statements to define the initial values specified in part (d).  Summer Diet -2- Continued Overleaf/ 2. (a) Describe the behavior of the 1-bit register circuit (reg1) with data input x, control input load, and output r.  (b) Design a circuit that takes two inputs a, b. It produces one output, x, which is defined by the truth table below. Implement the circuit using any of the standard logic gates (inv, and2, or2, xor2). You may specify the circuit using any of the following notations (just use one): a schematic diagram, Boolean algebra, or Hydra notation. a b x 0 0 1 0 1 1 1 0 0 1 1 1  (c) Explain what could happen in a synchronous circuit if the clock speed is too fast.  Summer Diet -3- /END (d) The following program takes two inputs: an integer x and a pointer header to a list header. The list is represented by nodes. Each node is a record consisting of two words: the first word value is an integer, and the second word next is a pointer to the rest of the list. The last node in the list has nil in the next field (nil is represented by 0). The value field of the list header is unused, and its next field points to the first node with a value (if any). p := header; q := p; p := (*p).next; done := false; while not done do if p=nil || x<(*p).value then { new := avail; avail := (*avail).next; (*new).value := x; (*new).next := p; (*q).next := new; done := true; } else { q := p; p := (*p).next; } Suppose the program is given x=5 and header points to a header for a list containing the initial values [3, 8, 9]. After the program executes, what is the value of the list that the header points to?  (e) Translate the program in part (d) 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. Just write the instructions that implement the algorithm, but not the data statements.  (f) Define the term concurrent processes. Explain how concurrent processes are implemented, and how the system ensures that all process continue to run even if one of them goes into an infinite loop. [

#### 在線客服  Essay_Cheery  