quiz5solns

quiz5solns - .BEGIN IN A IN B LOAD A COMPARE B JUMPLT LESS...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CMPS 10 Fall 2007 Quiz 5 Solutions 1. (10 Points) Consider the following instruction register format: Op Code Address-1 Address-2 Address-3 5 bits 17 bits 17 bits 17 bits a. (4 points) What is the maximum number of distinct op codes that can be recognized and executed by this processor? Answer: 32 b. (4 points) How many bytes of memory are needed to store one instruction? Answer: 7 c. (2 points) What is the maximum possible size (in kilobytes) of the memory unit? Answer: 128 KB 2. (10 Points) Given the instruction set above, consider the following assembly language program.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: .BEGIN IN A IN B LOAD A COMPARE B JUMPLT LESS JUMP PRINT LESS: STORE TEMP LOAD B STORE A LOAD TEMP STORE B PRINT: OUT A OUT B HALT A: .DATA 0 B: .DATA 0 TEMP: .DATA 0 .END a. (4 Points) What will be printed if the user enters 6 followed by 17 ? Answer: 6 17 b. (4 Points) What will be printed if the user enters 12 followed by 8 ? Answer: 8 12 c. (2 Points) What does this program do? Answer: the inputs are printed in ascending order, i.e. this program sorts a list of length two....
View Full Document

This note was uploaded on 09/15/2011 for the course CMPS 10 taught by Professor Tantalo during the Fall '08 term at UCSC.

Ask a homework question - tutors are online