Homework 2: Universal Gates & Flip Flops
CS 200 10 Points Total
Due Wednesday, February 8, 2017
Assignment
Answer each of the following questions based on Chapter 3 of the Null textbook.
1. Which gates are called "universal" gates? Why? (2 pts)
NAND and N
Homework 1: Digital Logic
CS 200 10 Points Total
Due Wednesday, February 1, 2017
Assignment
Answer each of the following questions.
1. Draw a truth table to demonstrate that xy' is equivalent to (x'+y)'. (2 pts)
2. Use a Karnaugh Map to reduce the followi
Project 9: Maze Generator
CS 200 20 Points Total
Due Friday, April 21, 2017
Objectives
Write a recursive maze generator in assembly.
Practice using procedural calling, general assembly programming, and using a highlevel
language implementation as a refer
Homework 6: Data Encoding
CS 200 10 + 5EC Points Total
Due Wednesday, March 22, 2017
Assignment
Read Chapter 2 of the textbook. Answer the following questions.
1. What causes divide underflow? (1 pt)
Divide underflow is happens when the divisor is much sm
Homework 3: C/C+
CS 200 10 Points Total
Due Wednesday, February 22, 2017
Assignment
Name the C/C+ bitwise operator used for the following operations. (1 pt each)
1.
2.
3.
4.
5.
Test bits with a mask.
Set bits with a mask.
Multiply by a power of 2.
Toggle
Homework 4: Number Base Conversions
CS 200 10 Points Total
Due Wednesday, March 1, 2017
Assignment
Perform the following number base conversions. All necessary steps to convert by hand should be
shown  any conversion without accompanying work will be cou
Homework 8: Assembly Language
CS 200 10 Points Total
Due Wednesday, April 5, 20167
Assignment
Work the following problems.
1. QTSPIM is loaded with the following program in the user text section. It will, after
running the builtin kernel, start at the in
Project 8: Bubble Sort
CS 200 20 Points Total
Due Friday, April 14, 2017
Objectives
Write a bubble sort in assembly.
Practice conditional jumps, indirect addressing, and using procedures/subroutines.
Requirements
Write a MIPS assembly language program tha
Homework 7: ISA
CS 200 10 Points Total
Due Wednesday, March 29, 2017
Assignment
Read chapter 5 of Computer Organization and Architecture and the accompanying slides and answer the
following problems.
1. Suppose I have the following memory map.
ADDRESS
3C6
Homework 5: Converting Fractions
CS 200 10 Points Total
Due Wednesday, March 8, 2017
Assignment
1. Perform the following conversions. All necessary steps to convert by hand should be shown  any
conversion without accompanying work will be counted wrong.
1) Based on the information above, write the MATLAB code to ask the user to enter a velocity in
m/s. Be sure to store the input in a variable that has a fitting name.
 Velocity = input (please enter a number in m/s)
please enter a number in m/s 75
Veloci
We want to plot the function y = x2 over the interval [1,3]. In order to do this, we need to establish an x vector (our independent variable) and a y vector (our dependent variable).
1. Given x = [1:0.05:3], write the MATLAB code to generate our y vector
1) Write the MATLAB code to generate a random number between 1 and 3 using the randi function. You can find more information about randi at
http:/www.mathworks.com/help/matlab/ref/randi.html.
 x = randi(3);
2) a. Write the pseudocode to ask the user whi
1) a. The nthroot function allows one to specify the degree of the root they wish to take (e.g., a
cube root would have a degree of 3, square 2, etc.). Write the MATLAB code to take the 5th root
of 187.
 y = nthroot(187, 5)
b. The length function can be
1) The following questions are intended to provide definitions that will aid in your understanding of future labs.
a) What is a variable?

A Variable is a region of memory containing an Array, which is a collection of data values
organized into columns a
1) The primary form of data in MATLAB is vectors. They can be onedimensional (i.e., vectors),
or twodimensional (i.e., matrices).
a) Write the MATLAB code to create a 1x3 vector containing the elements [1,2,3]. Additionally,
write the MATLAB code to cre
1) a. Assume we have a matrix, M. Using the dlmwrite function, write the MATLAB code to
write the matrix to a file named myfile.txt, and have the content of the matrix be separated by
commas.
 M = magic(3);
dlmwrite(myfile.txt,M);
type(myfile.txt)
b. Wha
1. Given the information above, write the MATLAB code for 3 nested for loops. Use the same
variable naming scheme as above, and have the following number of iterations:

for i = [1,2];
for j = [1,3];
for k = [1,2];
fprintf(i is: 0, j is: 0, k is: 0\n, i,
1. Define eigenvector. It is OK to paste a definition you found on the Internet, but include your
source (reference), e.g. the web URL from which you obtained the definition.
 A vector that when operated on by a given operator gives a scalar multiple of
1) As you have learned, you can use the input function to accept numbers. For example, the following code accepts a number and stores it in the variable named coin:
a) Based on the above discussion, write the MATLAB code to ask the user to enter a coin (q
CS 122 L
PreLab 4
February 21, 2017
Deliverables:
1) Given x = [1:0.05:3], write the MATLAB code to generate our y vector (Hint: refer to the
original function that we are trying to plot).
> x=[1:0.05:3]
x =
Columns 1 through 9
1.0000
1.0500
1.3500
1.400
CS 122 L3
PreLab 6
March 7, 2017
Deliverables
1a) Write the MATLAB code for 3 nested for loops. Use the same variable naming scheme as
given, and have the following number of iterations:
i (the outer loop) loops from 1 to 2
j (the second loop) loops fro
CS 122 L
PreLab 3a
February 14, 2017
Deliverables:
1. Define eigenvector.
Eigenvector:
A special set of vectors associated with a linear system of equations (i.e., a matrix equation) that
are sometimes also known as characteristic vectors, proper vectors
CS 122 L
PreLab 2
January 31, 2017
Deliverables:
1a. MATLAB code for 1x3 vector and 3x1 vector containing the element [1,2,3]
% a = 1x3 vector containing elements [1,2,3]
> a=[1 2 3]
a=
1
2
3
% b = 3x1 vector containing the elements [1,2,3]
> b = [1;2;3]
CS 122 L
PreLab 3
February 7, 2017
Deliverables:
1. Write the MATLAB code to ask the user to enter a velocity in m/s.
% asks the user to input value as velocity in m/s (70 m/s)
> velocity = input ('enter a velocity in m/s')
enter a velocity in m/s 70
vel
CS 122
PreLab 5
February 28, 2017
Deliverables:
1a) Based on the above discussion, write the MATLAB code to ask the user to enter a
coin (q for quarter, d for dime, n for nickel, p for penny).
Coin = input(Enter a coin value in quarters, q)
Coin = input(
CS 122 L
PreLab 7
March 21, 2017
Deliverables
1) Write the MATLAB code to generate a random number between 1 and 3 using the randi
function.
> random=randi(3,1,1)
random =
3
> random=randi(3,1,1)
random =
2
> random=randi(3,1,1)
random =
1
> random=randi
CS 122
PreLab 8
March 28, 2017
Deliverables
1a) Using the dlmwrite function, write the MATLAB code to write the matrix to a file
named myfile.txt, and have the content of the matrix be separated by commas.
> M=[1:.5:4;1:.5:4]
M =
1.0000
1.0000
1.5000
1.5
Lists and Dictionaries 1
1. The [1:3] was added in the second program to only show the last 2 numbers. It does not
allow more than 3 numbers to be entered. Changing the print statement to [:2] would
remove the third number.
2.
3.
1.
2.
3.
4.
5.
6.
7.
8.
9