Due Monday, January 30
Your assignment is the following:
Install GCC and emacs on your computer, according to the instructions on the
course web page.
Using emacs, type in and save following program in a file with a .c extension
Sample Exam I
Please answer questions 1 and 2 on this paper and put all other answers in the blue book.
1. True/False. Please circle the correct response.
a. T F In the C and assembly calling convention that we used for this class, arguments
Sample Midterm Exam 1
1. True/False. Circle the appropriate choice (there are no trick questions).
(a) T F
In C, a pointer variable is used for storing an address.
(b) T F
In x86 assembly, the eax register can be used to hold integers but not
Sample Midterm Exam 2
1. True/False. Circle the appropriate choice on this sheet (there are no trick questions).
(a) T F
The x86 registers (eax, ebx, etc.) are part of main memory (RAM).
(b) T F In C, a formal parameter that is an array of st
#define BOOL int
#define TRUE 1
#define FALSE 0
/This procedure prints out the individual bit values in a
/number by using a mask. The mask is initially 1000.000
/and gets shifted right by 1 bit each time through the loop.
/Note: The ma
Study Questions for Digital Logic
1. Build a decoder with three input lines but with only six output lines. If the value of the
input corresponds to 6 or 7, then all output lines should be asserted to signal an error.
2. Modify the 1-
Meeting time and place: Tuesdays 6:00-8:30 pm WWH 312
Instructor: Mohamed Zahran ([email protected])
Office hours: Tuesdays 2-4pm (WWH 320)
Check the web page for updated information about the course, announcements, as
Homework Assignment #2
1. Implement (i.e get the truth table, then the Boolean function, and finally draw
the logic diagram) the following functions using AND, OR, and NOT logic
gates. Assume A and B are the inputs and F is the out
Part 2: Implementing Instruction Fetch and Decode
Due Friday, May 11
The third, and last, part of the CPU project is to simulate instruction fetch (loading the
instruction from memory) and decode (figuring out what the instruction does based o
Part 2: Implementing the I-Instructions and J-Instructions
Due Monday, May 7
The second part of the CPU project is to simulate the I-instructions and J-Instructions
of the simple MIPS processor.
You have already downloaded the files you need,
Part 1: Implementing the R-Instructions
Due Monday, April 30
The first part of the CPU project is to simulate R-instructions of a simple MIPS
processor. Here are the steps you should take:
Download the one of the following compressed f
Due Monday, February 13
Your assignment is to create and manipulate a doubly-linked list. As you may
know, each cell in a doubly-linked list points both to the previous cell and the
next cell. A doubly-linked list is often convenient for dele
Due Monday, February 27
This assignment involves simple assembly language programming. After
reading the assignment, please be sure to read the important notes at the
bottom of this page.
Here are the steps you should perform:
1. Look closely
Due Monday, March 5
This assignment involves a short assembly language program that stresses making
procedure calls and accessing local variables.
The assignment is as follows:
Make sure you understand the calling convention described
Due Monday, March 12
This assignment stresses using the right memory addressing modes for accessing array
elements and structures.
The assignment is as follows:
Make sure you understand the programs that I wrote in class (and which I h
Due Monday, March 26
This assignment stresses using bitwise logical operators, masks, and shifts.
Read the sample programs.
In a file, say, assign6.c, copy the C code below for the procedure reverse,
which reverses the order of
Due Thursday, April 12
This assignment involves writing several different sorting algorithms and
timing their execution, to get a sense for the impact of different complexity
Download and read the code I showed in class on Apr
Due Monday, April 23
This homework assignment will 1) give you a bit of practice solving recurrence
relations in order to determine the asymptotic complexity of simple algorithms,
and 2) have you use an easy-to-use circuit simulator to build an
CPU Project Description
This project involves building a high-level simulator for the simple 32-bit MIPS CPU discussed
in class. The instruction set architecture (ISA, defining the registers, instructions, etc.) of this
CPU is similar to an early version
Handout First Day of Class (1/23/12)
This will be the only paper handout of the semester. All other material will be found on the
course web page, http:/cs.nyu.edu/courses/spring12/CSCIGA.1144001
/need this for printf
/need for malloc
/This file contains code that shows how to use
/pointers, structs (records) and malloc to
/implement a linked list (or any other graph-based
/data structure such as trees, etc.)
Homework Assignment #1
[1 pt] 2n
[2 pts] 6-bit representation: 100000 12-bit representation: 111111100000
[2 pts] 127 in decimal, 01111111 in binary.
[1 pt] Then there will be an overflow and the value stored in x will be