CS 230 Introduction to Computers and
Computer Systems
Module 6 Operating Systems
Martin Karsten
[email protected]
CS 230  Winter 2011
61
Overview
basic mechanisms
virtual memory
disks and file systems
interprocess communication
CS 230  Winter 2
Study Guide for Module 2: Assembly Language
(This guide is intended to provide short summaries of key terms and concepts to aid the study process.
This guide is not necessarily a complete statement of everything that could be on the exam anything
presente
CS 230 Introduction to Computers and
Computer Systems
Module 0  Introduction
Adel Fakih
[email protected]
1
CS 230  Fall 2012
Goals
Demystify how a computer system works
Overview of computer systems
from bottom to top (transistors to programs)
Hardwar
CS230 Fall 2012  Midterm Notes
Date and time: Oct 23, 2012  4:30 p.m.
Duration: 90 minutes
Location: MC4042 and MC4061. Check your seating assignment at https:/odysse
y.uwaterloo.ca/teaching/schedule
Electronic calculators are allowed.
Number of qu
CS230 Fall 2012  Assignment 3
Due Friday, Oct 19, 2012, 4:00 p.m.
All submissions are to be completed through MarkUs. The les submitted
must be either plain text les (.txt), or pdf les. MIPS les must be submitted as
plain text les. It is preferable to su
CS 230 Introduction to Computers and
Computer Systems
Module 0  Introduction
Martin Karsten
[email protected]
CS 230  Winter 2011
01
Goals / Overview
CS 230  Winter 2011
02
Goals
overview of computer systems
from bottom to top
understand basic
CS230 Fall 2012  Assignment 2
Due Friday, Oct 05, 2012, 4:00 p.m.
All submissions are to be completed through MarkUs. The les submitted
must be either plain text les (.txt), or pdf les. MIPS les must be submitted as
plain text les. It is preferable to su
CS230 Fall 2012  Assignment 2
Due Friday, Oct 05, 2012, 4:00 p.m.
All submissions are to be completed through MarkUs. The les submitted
must be either plain text les (.txt), or pdf les. MIPS les must be submitted as
plain text les. It is preferable to su
CS230 Fall 2012  Assignment 4
Due Sun, Nov 4, 2012, 4:00 p.m.
All submissions are to be completed through MarkUs. The les submitted
must be either plain text les (.txt), or pdf les. It is preferable to submit all the
les as text les to make it easier for
Summary of Lecture 4
Machine Code and Assembly Language
What You Should Know How To Do
Convert instructions from assembly
language to binary using the MIPS
Reference Sheet.
Understand the differences between Rformat, Iformat, and Jformat instructions.
R
Summary of Lecture 3
UTF8 and Strings
(Image is public domain, 1972. Courtesy of Wikipedia.)
What You Should Know How To Do
Convert numbers from binary to
hexademical and hexadecimal to binary.
Explain the differences between UTF8 and
ASCII.
Given the b
Summary of Lecture 1
Binary Logic and Arithmetic
What You Should Know How To Do
Construct logical expressions using
AND, OR, and NOT
Perform arithmetic in binary
Recognize when an arithmetic
operation would cause overflow
Words You Should Know
Bit
Binary
Study Guide for Module 3: Compilers
(This guide is intended to provide short summaries of key terms and concepts to aid the study process.
This guide is not necessarily a complete statement of everything that could be on the exam anything
presented during
CS 230 Tutorial 10: Regular Expression, CFGs
Note that questions about DFAs NFAs can have more than one
answer.
Q1
Describe the language defined by the following DFA:
Q1 Solution
The DFA describes a language of strings formed with 0s and 1s
that must cont
CS230 Fall 2012  Tutorial 9
Monday, Nov 19, 2012
1. Is the following CFG ambiguous? If not, explain why? If it is, show an
example of an expression that generates two unique parse trees.
<S> a<S>b<S>
 b<S>a<S>

This is an ambiguous grammar. Here is an
CS230 Fall 2012  Tutorial 1
Monday, Sep 17, 2012
This tutorial mainly introduces the basic commands in UNIX so that you can
interact with the Unix server (linux.student.cs.uwaterloo.ca).
1
INTERACTING WITH UNIX SERVERS
To connect to a UNIX server, you wi
CS230 Fall 2014 Assignment 5
Solutions
Q1 Regular Expressions
Give a regular expression that captures these various ways of representing integers in
Python.
[8 marks]
Answer: (+)_*(0b(01)+  [09]+  0x[09afA_F]+)
The answer consists of five parts
o
CS230 Fall 2014 Assignment 2
Due: Wednesday, Oct 15nd 2014 at 10 PM
All submissions are to be completed through MarkUs. The files submitted must be either
plain text files (.txt), or pdf files. Some questions on this and future assignments must be
submitt
CS 230 Tutorial 6: Assembly Language
Recall
I
High Level Language (HLL):
Scheme, Python (CS116)
Convenient for humans.
Use variables and arithmetic operators.
I
Assembly Language (AL):
MIPS (this course).
Use words instead of math symbols: add, sub etc.
M
CS 230 Tutorial 5
Floating Point Numbers
32 bit representation:
(1)s 1.y0 .y22 2e0 .e7
(1)
1 bit for s, 23 bits for the fraction, 8 bits for exponent including
sign.
To represent the most negative exponent and the most positive
exponent without twos compl
CS 230 Winter 2013 Tutorial 1
Monday, January 14, 2013
This tutorial mainly introduces the basic commands in UNIX so that you can interact with the Unix servers
(linux.student.cs.uwaterloo.ca).
0. HOW TO ACCESS THE COMMAND LINE
UNIX: look under "Applicat
CS 230 Winter 2013
Tutorial 2  Solutions
Monday, January 21, 2013
1. Convert the following values to decimal:
a. 10110110 (base 2, binary)
= 182
b. 34106 (base 7)
= 8630
c. 1D4FA (base 16, hexadecimal)
= 120 058
2. Convert the decimal value 4128 to:
a. B
CS 230 Tutorial 4
Simplifying a Boolean Expression
Suppose we got the following expression from the truth table
+ ABC
+ AB
C
+ +A
BC
F = ABC + AB C
Simplify this expression.
(1)
First two terms simplifies to:
= AB(C + C
) = AB
ABC + AB C
(2)
The nex
Another Cache Example
Recall the mapping from a memory address to a cache block from slide 52 in Module 3: m = (p/B)
mod M. Note that the division will provide an integer result. Assume that there are 8 blocks of cache
memory (M), and that each block in t
CS 230 Tutorial 8: Pipelining
1. Assume that the period of the clock cycles in a CPU is 200 ps.
Also, assume that the time it takes complete the stages of a MIPS
instruction are given below.
Instr
lw
sw
Rformat
beq
IF
200
200
200
200
Reg
100
100
100
100
CS 230 Tutorial 7: Assembly Language and
Performance
Leaf procedures do not call other procedures. Nonleaf
procedures must save their register data to be used after the
procedure. (See p102 of text book.)
Caller must save:
I
temporary registers ($t09) wh