{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

hw4_sol_s10 - 6.2 Sequence Decision Repetion True 6.4 IF A...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 2
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 6.2 Sequence, Decision, Repetion. True 6.4 IF A THEN ‘ False BEGIN B ENDIF A A) The N bit is set when the MSB of the result of a flag changing operation is zero. B) The Z flag is set when the result of a flag changing operation is zero. C) The V flag is set when there is not enough bit width to fit the signed result of a flag changing operation (such as an add or subtract) D) The C flag is set when there is not enough bit width to fit the UNsigned result of a flag changing operation (such as an add or subtract) 2. 9001, A000, B003, AO0C (Words and Bytes both take up just 1 address), B000 3. Suppose an array is stored at address A_BEGIN, and its size at A_SIZE. The new array will appear at B_BEGIN with the final element being the size. MOV ARO, #A_BEGIN ;STORES CURRENT ARRAY INDEX MOV ARI, #A__SIZE ;GET COUNTER ADDRESS MOV AH, *ARI ;COUNTER MOV AR2, #B_BEGIN LOOP MOV AL, *ARO++ ;PULL VAL AT INDEX, POST—INCREMENT ;ARRAY INDEX MOV *AR2++, AL ;STORE VAL IN B, POST-INCREMENT ;INDEX DEC AH ;DEC COUNTER B LOOP, NEQ ;BRANCH UNTIL ARRAY TRAVERSED MOV AL, *ARI ;STORE COUNT VAL AT END OF ARRAY B MOV *AR2, AL END B END, UNC ;END PROGRAM Adam Mills EEL4744: HW4 SOLUTIONS Version 1 (2009) er4 F0”? 4. An example of pipelining might be used in multiplying floating point numbers. Doing this in one clock cycle would force the clock speed of the processor down in order to give sufficient time for the output to stabilize. By splitting this process into multiple stages the output time can be decreased, allowing for faster processing. 5. Label: TOPl, Opcodes: 94C0, 0AAO, OBCZ, 60FD; Operands: AL, *ARO, ARO, *ARZ, TOPl, NEQ 6. HEX .set 0h BIN .set 11110000b DEC .set 65535 7. .bss COUNT,5 8. .data STRING .byte “Go Gators!” 9. 1) MOV AL, #0X8000 ADD AL, #0x8000 N=0, Z=l, C = l, V=1 2) MOV AL, #OXFFFF ADD AH, #4000 N=0, Z=0, C=l, V=0 3) MOV AL, #0x8000 ADD AL, #OXFOOO N=0, 2:0, c=1, V=1 4) MOV AL, #OX7F00 ADD AL, #0x3EEE N=1, 2:0, c=o, V=1 10. 1) MOV AL, #0x8000 SUB AL, #0x8000, N=0, z=1, C = 6,._V=0 2) MOV AL, #OXFFFF Adam Mills EEL4744: HW4 SOLUTIONS Version 1 (2009) MOV AH, #0x4000 SUB AL, AH N=1, 2:0, 0 = 0, V=0 3) MOV AL, #0x8000 SUB AL, #OXFOOO N=1, 2:0, 0 =0, V=O 4) MOV AL, #0x7F00 SUB AL, #0x3EEE N=0, z=0, c = b, V=0 11. 0000, 1234, 0045, 0045, 004C, 0034 ,0037, 0034 12. 28AO, A002, 28A1, 3003, 28A2, A000, 9303, 97C2 13. B000, B001, B002, B003, A000 Adam Mills EEL4744: HW4 SOLUTIONS Version 1 (2009) ...
View Full Document

{[ snackBarMessage ]}