MIPS ALU
Building from the adder to ALU
ALU Arithmetic Logic Unit, does the major calculations in
the computer, including
Add
And
Or
Sub
In MIPS, the ALU takes two 32-bit inputs and produces one
32-bit output, plus some additional signals
Add is on

MIPS Processor
Registers in MIPS
In MIPS, there are 32 Registers.
We need read up to two registers, and
write to up to one register.
Think registers as D flip-flops. Each
register has 32 Dffs.
The control signals are:
readReg1, readReg2: 5 bits. Used to

Introduction to Verilog
Data Types
A wire specifies a combinational signal.
Think of it as an actual wire.
A reg (register) holds a value.
A reg need not necessarily correspond to an
actual register in an implementation, although it
often will.
consta

Registers and Counters
Register
Register is built with gates, but has memory.
The only type of flip-flop required in this class
the D flip-flop
Has at least two inputs (both 1-bit): D and clk
Has at least one output (1-bit): Q
At the rising edge of

Digital Circuits
Question
Question
Review Getting the truth table
The first step in designing a digital circuit
usually is to get the truth table.
That is, for every input combination, figure
out what an output bit should be, and write
them down in a ta

Review
Interger Number Representations
To convert an unsigned decimal number to binary:
you divide the number N by 2, let the remainder be
the first digit. Then divide the quotient by 2, then let
the remainder be d1, then divide the quotient by 2,
then l

Finite State Machine Continued
In class exercise
Design a 2-bit up-down counter with a control
signal U. If U=0, count down, else count up.
Combinational and Sequential Circuit
Digital logic systems can be classified as
combinational or sequential.
Com

Digital Logic
Abstractions in CS (gates)
Basic Gate: Inverter
Truth Table
I O
0 1
1 0
I
GND
O
I
O
Resister (limits conductivity)
Vcc
2
Abstractions in CS (gates)
Truth Table
I O
0 1
1 0
I
O
3
Abstractions in CS (gates)
Basic Gate: NAND (Negated AND)
Tru

Review
Interger Number Representations
To convert an unsigned decimal number to binary: you divide the
number N by 2, let the remainder be the first digit. Then divide the
quotient by 2, then let the remainder be d1, then divide the quotient
by 2, then l

MIPS processor continued
Question
How to implement the datapath of a
processor supporting jal and R type?
jal and R-type
Control Signals
Control signals include ALUCtrl and the signals
to control the 2-1 selectors
They are generated according to the cu

Counters
In class excercise
How to implement a counter, which will
count as 0,3,1,4,5,7,0,3,1,
Q2
0
Q1
0
Q0
0
0
0
1
0
1
0
0
1
1
1
0
0
1
0
1
1
1
0
1
1
1
D2
D1
D0
Finite State Machines
Parity checking
Design a parity checking circuit that has one input X,

A Simplified MIPS Processor in
Verilog
Data Memory
module DM(MemRead, MemWrite, ABUS,
DIN, DATABUS);
MemWrite: Nothing happens if 0. If 1, the memory at
location ABUS will be written with DIN.
ABUS: At any moment, the data at location ABUS will
appear

The Karnaugh Map
K-map rules
Draw the K-map. Remember to make sure that the adjacent rows/columns
differ by only one bit.
According to the truth table, write 1 in the boxes.
Draw a circle around a rectangle with all 1s. The rectangle must have size
1,2

SDN and Openflow
Motivation
Since the invention of the Internet, we find many innovative ways
to use the Internet
Google, Facebook, Cloud computing, etc
All achieved through software innovations.
Internet infrastructure, however, is virtually unchange

Other Processors
Other Processors
Having learnt MIPS, we can learn other major
processors.
Not going to be able to cover everything; will
pick on the interesting aspects.
ARM
Advanced RISC Machine
The major processor for mobile and
embedded electronic

Mininet and Openflow Labs
Install Mininet (do not do this in class)
Download VirtualBox
Download Xming for windows (X11)
Download Mininet VM for linux-ubuntu
Start VirtualBox
Create a new VM for linux-ubuntu and the Mininet VM as the disk
image
Start the

Artificial Intelligence
CSC 361
Prof. Mohamed Batouche
Computer Science Department
CCIS King Saud University
Riyadh, Saudi Arabia
batouche@ccis.edu.sa
Syllabus
Course Description
This course provides a general
introduction to AI (Artificial Intelligence):