ELG2136final2020

pdf

School

University of Ottawa *

*We aren’t endorsed by this school

Course

2136

Subject

Computer Science

Date

Jan 9, 2024

Type

pdf

Pages

11

Uploaded by AmbassadorFlowerDeer8

Report
Suppose the SUB instruction was added to the basic computer studied in class. The definition of the instruction is as follows: Symbol |Opcode [Symbolic designation Description in words SUB 001 |AC ¢« AC- M[EA] Subtract memory from AC The effective address (EA) is calculated in the fetch cycle and is readily available at time T4. Sort the following micro instructions to implement the SUB instruction starting at time T4. __5 AC-—-AC 2 DR-—ACAC -DR _4 AC-—AC+DR 5 AC-AC+1 _1 DR - MI[AR] A digital computer represents its floating-point numbers using the IEEE format for single precision (32 bits). Calculate the exponent and the mantissa of (33.625)4( in this representation. What is the hexadecimal value corresponding to the IEEE FP format of this number. exponent = 127 + 5 = (132)4¢ = (10000100), Mantissa = (00001101), Hexadecimal value = (42068000)44 B ceg2136-final-exam-Q2.pdf (271.74 KB) The output of a combinational circuit which implements a majority function F(x,y,z) is equal to 1 if more input variables are equal to 1 rather than 0. The output is O otherwise, e.g. F(1,1,0)=1, F(0,0,1)=0. Which of the following expressions represent the simplified expression for function F? F= xz +xy F=x+zy+z o F=xy+xz+yz F=x® z
Use 2's complement representation to convert to binary the following signed numbers: (104.75)10 = Blank 1 (-44.125)4 = Blank 2 A 12 bit register is used to store these numbers in a fixed point format, with 4 bits after the binary point. What is the hexadecimal value of the register’s contents when storing the above binary numbers ? (Format: Hexadecimal without any binary points) (104.75)1¢ = HEX Blank 3 (-44.125)10 = HEX Blank 4 Fill in the following Blank #s with your results. Answer for blank # 1: 001101000.11 Answer for blank # 2: 1010011.11 Answer for blank # 3: D8C Answer for blank # 4: 53E The 4-bit multi-function register (Q) employed in the following logic circuit has two control inputs (S4, Sg). This register can perform four functions depending on the values of Sq and Sg, as described in the following table: SO|S1 Function 00 Hold Q Value o1 Clear Q o Y Decrement Q P Load parallel Input QG Q Q Q A B Ittt 1 C L] S, Out; Out; Out; Out, S, In,yIn, In, In,, T T I I Clock 13 I2 II l(: Register Q is controlled by three external signals A, B and C through the gates shown in the logic diagram. | (|3|2|1|0] is the register inputs and Q (Q2Q2Q1Qp) is the output (content) of the register. What will be the new value of Q after the clock pulse in the following scenarios: 1)fQ~=1111,1- 1111, A~1, B~ 1, andC~ 1 2)1fQ~=0001,1~1000,A=0,B=0,andC~0 3)1fQ+=1010.1= 0101, A=0,B=1,andC~ 1 Answer for blank # 1: 0000 Answer for blank # 2: 0000 Answer for blank # 3: 0101
An interrupt service routine (ISR) resides in memory starting from address HEX 567. It has to be executed after the computer recognizes an interrupt when FGO becomes 1 (while IEN=1). The machine codes of the instructions used in this question are given in RED fonts below. Refer to the List of the Basic Computer Instructions to convert them to Assembly Language. Select the machine code corresponding to each instruction indicated by the following specifications: 3__ ... is the last instruction in the ISR. 1. 4567 2 _ ...is the instruction before the last instruction in the ISR. 2. FO80 1 _ .. is the instruction at address HEX001. 3. C000 Question 7 4 / 5 points A 4-bit arithmetic unit (AU) can perform eight operations on operands stored in two 4-bit registers A and B as shown in the following table. The operation to be performed is selected by two variables X and Y, while the 1-bit variable Z is an input of full adder. Z x|y 0 1 OPO |Blank 1 0|0| F=A | F=A+#1 OP1 |Blank 2 0|1|F=A+2| F=A+3 OP2 |Blank 3 1|0 | F=A+B |[F=A+B+1 OP3 |Blank 4 1|1| AB-1| A-B OP4 |[Blank 5 OPO OP1 o \Lt‘ln oP2 (1 | - F orP3 L2 L/ 0P4 |43 The expressions for OP0O, OP1, ..., OP4 is given by: Answer for blank # 1: A Answer for blank # 2: 0 Answer for blank # 3: 2 Answer for blank # 4: B Answer for blank # 5: -B
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Question 8 1/1 point A memory unit with capacity 210 x 10 means: ¢ It has 10-bit words, and can store up to 1K-words It has 16-bit words, and can store up to 4K-words It has 10-bit words, and can store up to 10K-bits It has 10-bit words. and can store up to 4K-bits Question 9 1.5/ 2 points A 1 bit general purpose register is designed using D-Flip-Flop. The register supports the following functionalities: Store (Hold), Clear (C) and Load (L) of data input A. Find the equation for the D input to the flip flop. The Function F(LA.C.Q)* ____ (Answer format: Don't leave blanks) Output Function L C Y=Q[t+1) Store 0 0 Qit) Clear 0 1 0 Load 1 X A L | D Q ] F > A N e Ul o Answer: AL+QtL'C
An excerpt relevant to this question from Table 5.6 - Control Functions and Microoperations for the Basic Computer that we studied in class, is given below. Fill in the blank #'s defined in the following table to show the contents of the CPU registers AC, AR, IR and Bus Select during the micro-instructions execution of the instruction ADD PTR |; PTR is at address ABC. M[ABC] = 0123 and M[123]= 0789. NOTE: All values are in hexadecimal. |g‘ |Ius Select| |FEZch |77, [4R < AC AC AR IR [Bus Select AR 1 RT;: |!R M[AR],PC < PC+1 10 FFFF 244 X Blank1 PC 2 Decode |R7,: |DO,..., D7 Decode IR(12-14), 11 Blank2 | Blanka DR 3 AR IR(0-11), | < IR{15) 2 Blanka BlankS AC a Indirect [D'5iT;. |AR & MJAR] 13 Blank6 Blank7? IR 5 T4 Blank8 R 6 ADD D;T;7 |DR M[AR] 15 | 8lanka | Blanki0 MEM 7 D;T:0 |AC< AC+DR,5C<0 Answer for blank # 1: 2 Answer for blank # 2: 907B Answer for blank # 3: 7 Answer for blank # 4: 0078 Answer for blank # 5: 5 Answer for blank # 6: 0315 Answer for blank # 7: 7 Answer for blank # 8: 5 Answer for blank # 9: 0314 Answer for blank # 10: 0078
An excerpt from Table 5.6 (Control Functions and Microoperations for the Basic Computer) for the interrupt cycle defined in the basic computer that we studied in class is given in the following table. Fill in the blank# of the table with the values of the registers PC, AR, SC and the control of Bus Select. Note that the table columns indicate the value at the end of the cycle. pc | ar [ sc [Bussetect Micro Instruction [Register[Bus Select RTg| 123 |Blankl |Blank2| Blankd |AR <0, TR & PC AR 1 RTy Blankd |M[AR] & TR, PC €0 PC 2 RT3 aianks PC PC+1,IEN < 0,R €0, SC €0 DR 3 AC 4 IR 5 R 3 MEM 7 Answer for blank # 1: O Answer for blank # 2: 0 Answer for blank # 3: 2 Answer for blank # 4: 6 Answer for blank # 5: 1 Question 12 1/ 1 poini The capacity of a memory is 221 y 32 bits. Its capacity expressed in megabytes is: 2MB 64 MB 32 MB e 8MB
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
The instruction set of the basic computer is given for reference. Use these instructions to trace the assembly program given below 1. First, fill in the column labeled Machine-Code with « the program machine code and « initial values of the variables (marked in RED fonts) that are used in the program (8 marks) 2. Then, while tracing the code, mark (in decimal) the order of instructions executed, starting from 1. in the column labeled Order. If an instruction was visited (executed) more than one time, put a comma (,) followed by the new order number (whili not leaving any spaces between characters). Also, fill in in the rest of the column labeled Order with the final values (in hexadecimal) of the variables (marked in RED fonts) at the end of the program execution. Write your answers in the Fill-in-the-Blanks sections just after the following table. NOTE: Al values must be in hexodecimal [Address ORG 200 Machine-Code| Order Description 200 LDA X | BND memory word to AC 201 STA RES dd memory word to AC 202 LDA X Load memory word to AC 203 STA TMP Ktore content of AC in memory 204 |CMP, LDATMP I { Branch unconditionally 205 CMA XX Branch and save return address 206 INC ncrement and skip if zero 207 ISZ X Clear AC 208 ADD X | Clear E 209 SNA Complement AC 20A BUN WRX Complement £ 208 BUN CHK Circulate right ACand £ 20C JWRX, LDAXI Circulate left ACand E 20D STA RES ncrement AC e o o |7010 5;:)[:::: instruction if AC o R sna |7008 i::‘lr v::: instruction if AC 210 JCHK, ISZ CTR SZA |7004 Bkip next instruction if AC zero 211 BUN CMP SZE |17002 bkip next instruction if E is O 212 HLT HLT ]7001 {alt computer ORG 500 INP FE00 Jnput character to AC 500 |CTR, DEC-2 ouT F400 Putput character from AC 501 |TMP, HEX O SKI F200 Ekip on input flag 502 |RES, MEXO SKO F100 Bkip on output flag 503 X, HEX 600 ION FO80 Jnterrupt on ORG 600 oP FO40 Jnterrupt off 600 DEC 10 601 DEC 30 602 DEC 20 END 1. First, fill in the following blanks, representing the first column of the table labeled op-code, with « the program machine code and « initial values of the variables (in RED fonts) used in the program 4 hexadecimal digits will be used for every blank, given that they represent contents of 16-bit memory locations in the Basic Computer. (8 marks) Address ORG 200 Machine-Code
Address ORG 200 Machine-Code 200 LDA X | 201 STARES 202 LDAX 203 STATMP 204 CMP, LDATMP | __A501 205 CMA 7200 209 SNA 7008 20A° BUN WRX 420C 20B BUNCHK __4210 _ 20C WRX, LDAX | __A503 __ 20D STARES 20E LDAX 20F STATMP
210 CHK, ISZ CTR 6500 211 BUNCMP 4204 212 HLT ___7001 _ ORG 500 500 CTR, DEC -2 FFFE 501 TMP, HEX O 0000 502 RES, HEX O 0000 503 X, HEX 600 ___0600___ ORG 600 600 DEC10 601 DEC30 602 DEC20 END
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
2. Then, while tracing the code, mark (in decimal) the order of instructions executed, starting from 1, by filling in the corresponding blanks that represent the column labeled Order. If an instruction was visited (executed) more than one time, put a comma () followed by the new order number (while not leaving any spaces between characters). Also, fill in in the rest of the column labeled Order with the final values (in hexadecimal) of the variables (marked in RED fonts) at the end of the program execution. 4 hexadecimal digits will be used for every value, given that they are stored in 16-bit memory locations of the Basic Computer. Address ORG 200 Order 200 LDAXI 1 201 STA RES 2 202 LDAX 3 203 STATMP 4 204 CMP, LDATMP | 5.18 _ 205 CMA 6.19 206 INC __7.20 207 ISZX 821 208 ADDXI 9222 _ 209 SNA _10.23 20A BUN WRX 11 20B BUN CHK 24 20C WRX, LDAX | 12
20D STARES 13 20E LDAX 14 20F STATMP 15 210 CHK, ISZCTR _16.25 _ 211 BUNCMP 17 212 HLT 26 ORG 500 500 CTR, DEC -2 __FFFF___ 501 TMP, HEX 0 0601 502 RES, HEX O O01E 503 X, HEX 600 __0602 ORG 600 600 DEC10 601 DEC30 602 DEC20 END In just one sentence, explain what is the goal of the program from the above question, what does it do? It does two's complement subtraction on the given values until the counter reaches zero.