0% found this document useful (0 votes)
24 views41 pages

01 Lec-Intro To Digital Logic-Slides

This document provides an overview of the CSC258 course on computer organization at the University of Toronto. It discusses the following key points in 3 sentences: The course covers topics related to computer architecture through weekly lectures and tutorials, with labs and a project making up 28% and 14% of the grade respectively. Exams include a midterm worth 18% and a final exam worth 40%, which students must receive a mark of 40% or higher to pass the course. The document seeks to explain the relevance and purpose of studying computer organization for computer science students, comparing concepts like boolean values and integer representation to their implementation in computer hardware using logic gates.

Uploaded by

Hanif Nur Ilham
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
24 views41 pages

01 Lec-Intro To Digital Logic-Slides

This document provides an overview of the CSC258 course on computer organization at the University of Toronto. It discusses the following key points in 3 sentences: The course covers topics related to computer architecture through weekly lectures and tutorials, with labs and a project making up 28% and 14% of the grade respectively. Exams include a midterm worth 18% and a final exam worth 40%, which students must receive a mark of 40% or higher to pass the course. The document seeks to explain the relevance and purpose of studying computer organization for computer science students, comparing concepts like boolean values and integer representation to their implementation in computer hardware using logic gates.

Uploaded by

Hanif Nur Ilham
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 41

CSC258: Computer

Organization
Original Instructor & Slides: Steve Engels, sengels@cs.toronto.edu

Instructor: Maziar Goudarzi, goudarzi@ece.utoronto.ca


Marshall Ho, marshall.ho@utoronto.ca
Breaking down CSC258
CSC258 Course Details
 Lectures
 Lectures cover topics (generally one per week)
 Each week builds on the week before
 Tutorials
 30 minutes topic review (from previous week)
 30 minutes lab prep (for following week)
CSC258 Course Details
 Labs (28%):
 7 total (4% each)
 Each lab consists of two parts:
 Pre-lab exercises (1%, submitted ahead of time)
 In-lab demonstrations (3%): perform lab tasks for
TAs in the lab rooms (BA3145, BA3155, BA3165).
 Must work in pairs, in your assigned room.
 The partner and lab station you choose in Lab 1
are fixed for all remaining labs.
 No eating or drinking allowed in the lab rooms.
CSC258 Course Details
 Project (14%):
 Project proposal (2%)
 3 milestone demos (4% each)
 Goal: Large, cool digital creation.
 Exams:
 Midterm (18%) – Feb 26, 7pm-9pm in SS1071, SS
1083, SS 1087, WI 1016, WI 1017.
 Email us ASAP if you have conflicts.
 Final exam (40%)
 Must get 40% to pass the course.
Finally, two common questions

What is the point of this


course?
Why are you making
me take this?
“Why are you making me take this?”

 CSC258 isn’t needed if you’re just a causal


technology user.
 You can still drive a
car, even if you don’t
understand how the
engine works.
“Why are you making me take this?”

 Computer science majors aren’t casual


technology users.
 At the very least, you’ll
need to know how the
programs you write are
affected by hardware.
 Processor knowledge is
needed for OS courses.
 Assembly language is
needed for low-level
tasks like compilers.
“What is the point of this course?”

 Course outcomes:
 Understand the underlying
architecture of computer
systems.
 Learn how to best use this
architecture to store data
and create behaviour.
 Use the principles of
hardware design to create
digital logic solutions to
given problems.
“What is the point of this course?”

 Our course goals:


 Make you a better computer scientist.
 Expose you to new programming paradigms.
 Give deeper insights into past/current courses.
 Help prepare you for future courses.
 How we do this:
 Show you how your computer works.
 Start from electricity, end with assembly.
Let the learning begin
A few questions to start
 How much do you actually understand about your
computer and the programs you run?
 For instance:
1. When you set a variable to “false” or “true”, how are
these boolean values stored?
2. Why is there a maximum value for an int?
3. Is it cheaper to do an addition operation or a multiplication?
4. How do boolean operations like “and”, “or” and “not” work?
5. What happens when you press Ctrl-Alt-Delete?
6. What happens when you compile a Java or C program?
7. What causes a blue screen error on your computer?
CSC258 has the answers
 Computers are physical things, therefore they
have certain behaviours and limitations.
 For instance:
 Data values are finite.
 All data is stored as ones
and zeroes at some level.
 Many high-level operations
depend on low-level ones.
 The way computers are
today take their origins from how computers
were created in the past.
Example #1: Booleans
 How are boolean values stored?
 Example: if statements:

if x:
print ‘Hello World’
# what values of x will make
# this print out “Hello World”?

 What if x is a boolean?
All comes down to
 What if x is an int?
hardware in the end!
 What if x is a string?
Example #2: Integers
 How are int values stored?
 Again, as ones and zeroes.

12345  0011000000111001

 How many values can integers have?


 This can vary based on language and architecture,
but generally integers have 232 different values.
 Signed integers: range from -231 to 231-1
 Unsigned integers: range from 0 to 232-1
 Different ranges for long, short and byte.
What does it all mean?
 Computers do on the hardware level what
programs do on the software level.

 Understanding that software is just the outer


layer to the underlying hardware will help you
better understand software behaviour.
Programming parallels

Python/Java Computer hardware


 Boolean variables  High and low wire values
 Boolean operations (and,  Logic gates (AND, OR,
or, not, etc) NOT, etc)
 Integers, doubles, chars  Registers
 Addition, subtraction,  Adder circuits, multiplier
multiplication circuits
 Storing values  Memory
 Executing instructions  Processors
What you should already know
Programming from CSC148
 You need to have basic coding literacy.

 However…
 For CSC258, be prepared to let that all go.
 Verilog → specification language
 Assembly → low-level programming
 Trying to connect these languages to CSC148 will
only hold you back.
 Embrace new ways of thinking!
Logic from CSC165
 Thanks to CSC165, you’re already familiar with the
first piece of CSC258: basics of logic gates.
 CSC165 example: Create an expression that is true
if the variables A and B are true, or C and D are
true.
G = A & B | C & D

 CSC258 example: Create a circuit that turns on if


inputs A and B are on, or inputs C and D are on:
A
B
G
C
D
CSC165 for circuit design
 Starting with CSC165: A
Y
 Create simple circuits based on B
logical (boolean) expressions
 Combine circuits together to create A
Y
bigger and more complicated B
systems.
 The smallest logical operations
are represented by pieces of A Y

hardware called gates.


 Like boolean expressions, gates A
determine whether the ouput of a Y
B
circuit will be on or off as an
expression of the input signals.
AND Gates A
Y
B

A B
Y A B Y
0 0 0
+ 0 1 0
-
1 0 0
1 1 1
OR Gates A
Y
B
A

B Y
A B Y
+ 0 0 0
-
0 1 1
1 0 1
1 1 1
NOT Gates
A Y

+
-
A
A Y
Y
0 1
1 0
This is another A
transistor, which
connects the two sides
when A is turned off.
Note that its state
(on/off) is the
complement of the
other switch below.
More on this later too.
XOR Gates A
Y
B

A B

Y
+
- A B Y
0 0 0
A B
0 1 1
1 0 1
1 1 0
Bill Gates

 …ha ha…moving on….


NAND Gates A
Y
B
+
-
A B

A A B Y
0 0 1
B
0 1 1
1 0 1
1 1 0
NOR Gates A
Y
B
+
- A

A B Y

A B 0 0 1
0 1 0
1 0 0
1 1 0
Buffer
A Y

Y
+ A Y
-
0 0
1 1
From gates back to CSC165 (the little
circle here
acts like a
 Given a logic problem A NOT gate)

or circuit, can you make B


Y
a truth table to describe A
its behavior (as in C
CSC165)?
A B C Y
 Can also be illustrated 0 0 0
using a waveform. 0 0 1
C 0 1 0
0 1 1
B
1 0 0
A 1 0 1

Y 1 1 0
1 1 1
From expressions to circuits
 Creating and expressing circuit logic is similar to
working with boolean logic in Python, C or Java:

Y = (!A and !B and !C) or (!A and


B and C) or (A and B and C)

¬A
¬B
¬C
¬A
B Y
C
A
B
C
Things you might not know yet
Thinking in hardware
 Although CSC258 has elements
that are similar to other
courses, it is very different
in significant ways.
 Unlike software courses,
CSC258 is not about creating
programs and algorithms, but
rather devices and machines.
 Very important concept to
grasp early in this course!
 For instance: We need to understand what certain terms
mean in the context of hardware.
“True” and “False” in CSC258
 If a circuit performs a logical operation, how
does it represent “true” and “false”?
 In hardware, these boolean values are represented as
electrical voltage values on a wire:
 “False” (aka zero): little to no voltage at that point.
 “True” (aka one): typically a voltage difference of 5
volts, relative to the ground.

+ +
-
R vR -
R vR
Behind gates
 For electricians, switches
are physical devices for +
R vR =0
manually closing a circuit. -

 Gates are like switches,


which control whether an
output wire will have a
high value (5V) or a low +
value (0V) -
R vR =1
 Unlike physical switches,
gates are semi-conductor
devices that take electrical
inputs to close the circuit.
Expressions => Circuits
 CSC258 tasks assume that we have input signals
can be turned on (one) or off (zero), and we need
outputs that act as a function of these signals.
 Example #1: If the Ctrl, Alt and Delete buttons are
being pressed, restart the computer.
 Example #2: If a train is approaching the platform,
only turn on the green signal light if the track is clear
and the previous train is a certain distance away.
 Every electronic device uses gates to combine
input signals to create these output signals.
 Very similar to CSC165 problems, but in hardware.
Example: Ctrl-Alt-Delete
Ctrl Alt Del RESTART
0 0 0 0
Ctrl Alt 0 0 1 0
0 1 0 0
0 1 1 0
+ Del
- 1 0 0 0
1 0 1 0
RESTART 1 1 0 0
1 1 1 1
What we ask you to do (e.g. labs)

 Given a truth table or A B C MOVE


circuit description, 0 0 0 1
determine the circuit that
0 0 1 0
creates it.
0 1 0 0
 Look at the conditions
that cause high output 0 1 1 1
signals. 1 0 0 0
 Express the high 1 0 1 0
conditions as a Boolean 1 1 0 0
statement, then convert 1 1 1 1
this to gates.
The course at a glance

Assembly Language

Processors
Arithmetic Finite State
Logic Units Machines
Devices Flip-flops
Circuits
Gates

Transistors
Starting from the bottom
 Gates can combine values together like
logical operators in C or Java.
 But how do gates work?
 First, we need to
understand electricity.
 Then, we need to
understand transistors.
Resources put for you on
Quercus
 Course infosheet
 Quercus/Canvas: https://q.utoronto.ca
 Login with your UTORid
 Go to CSC258 course
 Under the Modules menu
 Lab breadboard demo
 DE1-SoC pin assignment file
 Many more: educational videos, Quartus
installation and usage guides, Verilog tutorials,…

You might also like