; For the Datum provided do three kinds of Shifts instructions,
; Each of them in the right and left direction.
; Shifts are: Logical, Arithmetic and Circular
; Each shift instruction will be printed along with its original data.
Homework 6 Due 12:00PM on Monday, April 9
Primary contact for this homework: Yinggang Huang [firstname.lastname@example.org]
You must do this homework in groups of two. This homework must be submitted online. No hard copies
will be accepted.
Page | 1
Which phases always occur during the processing of every instruction?
_FETCH and DECODE_
Which phase is specific to the DATA MOVEMENT instructions?
; This program will:
; Set the bits for the DATA according to the MASK
; Complement the bits for the DATA according to the MASK
; Test for Carry and Overflow for four different additions (R1 + R2)
; If Carry and/or Overflow is detected, the subsequent l
August 1, 2013
Student #: _
Please turn your communication devices OFF
There are questions on 4 pages.
Write your answers in the spaces provided.
You must answer all 4 question
Assignment #1: Machine Language
DUE: Wednesday, July 8
1) Download the source code for Figure 5.17 from the textbook webpage as code1.bin.
Enter x3000 for the programs load-address as the first line of the program.
It is required to assign a unique integer ID number to each student in a class of
100 students. What is the minimum number of bits required?
What range of signed integer values can be represented in
Determine the decimal value of the byte
Assignment #2: Assembly Language
DUE: Sunday, July 19
The LC-3 provides TRAP routines for character input and output. For this assignment,
you must implement and test user subroutines for input and output of unsigned
Patt & Patel, Problem 3.24, Page 89
a. What is the output of the circuit?
When X = 0, S =
When X = 1, S =
b. Modify the circuit (small adjustments only) so that
When X = 0, S = A + B
When X = 1, S = A - B
Figure 3.39, page 89
Assignment #3: Assembly Language
Software integer multiplication can be implemented using shifting and addition. One algorithm
is described in the class notes:
Assignment #1: Machine Language
DUE: Sunday, November 08
1) Download the (incomplete) source code for Figure 5.17. Save it as charCount1.bin.
Enter x3000 for the programs load-address on the first line of the program.
7.1 Assembly Language Programming
Assembly languages let us use mnemonic devices for opcodes (e.g. ADD and NOT) and give
meaningful symbolic names to memory locations (e.g. SUM and PRODUCT), rather than use
their 16-bit addresses.
7.2 An Assembly Language
3-Input Majority Function
1 if a majority of the inputs are 1, 0 otherwise
2-level AND-OR implementation
An AND-gate for each row of the table with 1 in the output
1) The enabling mechanism that allows the device to interrupt the processor (Ch. 8)
2) The process that manages the transfer of the I/O data (Ch. 10.2)
I/O Data Transfer
1) Initiate the interrupt
a) Save the state of the interrupted p
Program ABC is executing instruction_N
Program ABC is executing instruction_N+1
Program ABC is executing instruction_N+2
Processor detects an Interrupt Signal
Program ABC execution is suspended
Binary equivalent of a real number
Convert the integer part by repeated division by 2 (or some other algorithm)
Convert the fraction part by repeated multiplication by 2
Join these two parts together to form a binary fixed point number
Signed Integer Representations
All representations: 0/1
in the high bit position indicates +/-
High bit stores 0/1 to represent +/ Remaining n-1 bits store the magnitude of the integer
Example (1 Byte):
= b0011 1011
Hello, Im Alain Galvan, a student in your CDA3103 U01 class. I thought Id
spend a bit of time making a web game for your students to play around with
converting binary and hex numbers to decimal. Here, check it out.
MAR PC; PC PC + 1;
rd; MDR memory[MAR];
IR[15:12] interpreted by Control Unit
Calculate memory address needed to complete
the operation identified at the DECODE phase
Obtain data from
a AND b
a OR b
a XOR b
0 AND x = 0
1 AND x = x
AND to clear bits
-0 OR x = x
Data: x x x x x x x x
1 OR x = 1
Mask: 1 1 1 1 0 0 0 0
OR to set bits
General Division Algorithm
Algorithm is described for N-bit unsigned integers. It assumes a double-length (2N-bit) dividend,
an N-bit divisor and obtains N-bit quotient and remainder.
REM: Accumulator Register QUO: Quotient Register DVR: Divisor Register
Copy contents of PC into MAR (MAR <- PC);
The PC becomes PC+1. (PC <- PC+1);
Send read signal to the memory (rd);
Copy contents of the memory at MAR into MDR
(MDR <- memory [MAR]);
Copy contents of MDR into IR. (IR<-MDR);
starting address of program
end of program
allocate n words of storage
allocate one word, initialize with value n
allocate n+1 locations,