Lesson 5 Cisc 101
Quiz Deets

Reminding you of important points
Making sure you stay up to date on material
Mental prep for future concepts
Todays plan

Hexadecimal to Binary conversions!
Understand how all this hardware works!
Boolean logic
Gates
Numer
Lesson 7
Halfbit and Fullbit adders

Half bit adder only adds two bits (only 2 inputs), ignores any carry from previous addition
Fullbit adders consider carry input (3 inputs)
So why do we even consider half bit adders?
Operating Systems
An operating
Lesson 8 Data in Python
Boolean Notation
A and B
A.B
A^B
A or B
A+B
AvB
Not A
>A
A XOR B
A B (plus in circle)
Its all about Data!
Literals
To take something literally is to take it at face value
The same is true of literals in programming
A literal is a s
CISC 101 Computer Hardware
Remember Binary ? How we talk computer
For numbers in base 2, there are two possible digits (0,1) in which each column is a power of two:
128
64
32
16
8
4
2
1
2^7
2^6
2^5
2^4
2^3
2^2
2^1
2^0
0
1
1
0
0
0
1
1
= 99
From decimal to
Lesson 6
NOR gate
2 input NOR gate
NAND gate
Negation of AND!
Either or , but not BOTH
A
B
Y
0
0
1
0
1
1
1
0
1
1
1
0
The XOR
True if either are true, but hates copy cats!
A
B
Y
0
0
0
0
1
1
1
0
1
1
1
1
Adding Binary Single bit adder
45701
+ 23472
69173
Thr
Variables and Identifiers
Art of Computing > Algorithms > Information Theory > Computer Hardware
Data representation > Hexa, Octal, Decimal and Conversions > Boolean Logic > gates > half bit full bit
adders > user application operating system hard
Lesson 11 Expressions and
Data in Python
What types of Operators ?
Division A special case
Python provides two forms of division.
True division is denoted by /
25 / 10 evaluates to 2.5
(Basically actually divide)
Truncating division is denoted by / provid
Lesson 13 Debugging & BIFs
Debugging
1)
2)
3)
4)
Recognize the bug
Determine TYPE of bug
FIND the bug
CRUSH THE BUG
Syntax Errors

Python IDLE will tell us where to look
How do we fix them?

Find the correct syntax via Python Documentation or Google
Com
Lesson 12 Iterative Control
Multiway selection by Use of elif Header
If grade >= 90;
Print(Grade of A)
Elif grade >= 80;
Print(Grade of B)
Elif grade >= 70;
Print(Grade of C)
Elif grade >= 60;
Print(Grade of D)
Else;
Print(Grade of F)
If else if
Control
Lesson 14 List and Tuples
Tuples
To distinguish tuples from lists, tuples are denoted by parentheses instead of square brackets:
Nums = (10, 20 , 30)
Tuples: Syntax Rules
Tuples of one element must include a comma following the element.
Correct
Wrong
> (1
Computer Science  Lesson 3
All computers can compute the exact same things, given enough time and storage!
We needed
A simple language
One with a realistic hardware implementation
All we have is electricity
Having n binary digits
We can represent
2n1 st
Solving a Problem
Phase 1 Problem Definition
What is the problem?
Clear definition
Are there subproblems? E.g, best fit given 50 seats
What are the parameters?
Number of guests?
Number of troubling guests?
Capacity
Separate important factors from fluff
D
YEAR
the
of
and
in
to
a
for
our
to
from
as
or
we
on
company
by
with
is
sales
be
are
was
ended
quarter
fiscal
at
other
which
an
months
year
its
operating
$
operations
revenues
increased
have
income
products
cash
costs
financial
these
primarily
that
will
we
Must be uploaded within half an hour of the end of your lab in Week 2
(This is a grace period; you should be easily able to complete labs in the available time. Don't
assume that Moodle's clock agrees with yours.)
Each week's lab assumes that you are fami
Lab exercises 2
Must be uploaded within half an hour of the end of your lab in Week 3
This week is a workingindividually lab.
All work that you hand in must be done by you. You can ask other people questions, especially
the TAs, but the work must be your
the
of
and
in
to
a
for
our
to
from
as
or
we
on
company
by
with
is
sales
be
are
was
ended
quarter
fiscal
at
other
which
an
months
year
its
operating
$
operations
revenues
increased
have
income
products
cash
costs
financial
these
primarily
that
will
were
th
Cisc 101 Assignment
1a) It will be an odd number
b) it will be an even number
c) it will be an odd number
d) Itll keep getting doubled
e) Itll keep getting doubled
F 30 / 2 = C
2) Algorithm
 Input temperature in Fahrenheit
 Subtract 30 from the Fahrenhe
CISC 101 Lesson 2
About CISC 101
Orthodox Computer Science
Well perfect modelling and abstraction before jumping to coding
Algorithms are at the heart of computer science, we cant cut corners
Remember the coding rule:
The sooner you start, the longer it t
Lesson 15 Iteration &
Operations on Python Lists
Sequences
A sequence in Python is a linearly ordered set of elements accessed by index number
Tuples and strings are immutable and cannot be changed
The Slice Operator!
Returns a slice of the original seque
Lesson 10  Variables
What is a Variable?
A variable is a name (identifier) that is associated with a value,
Num 10
Value vs. Name
Num = 5
VS.
X = num + 10
Variables are assigned values by assignment operator
X=5
So what does:
Num = num + 1
A note on inpu
Lesson 16 For loop and range()
function
Assignment 4
Q2 Speech analysis

Lookup function set() it will make life easier, super powerful
The For statement
The For statement is a convenient way to Iterate over Sequences
for statement
for k in sequence:
Exa
Winter 2016 CISC101
1/6/2016
Today
Computer History Museum
Take some of the MAGIC out of how computers
work:
A very well laid out and informative site covering
the history of computing:
An overview of computer architecture.
How did the technology get
Winter 2016 CISC101
1/12/2016
Today
Numeric Representation
Numeric representation (or How does binary and
hexadecimal work?).
Binary numbers or base 2 is a natural
representation of numbers to a computer.
As a transition, hexadecimal (or hex, base 16)
Winter 2016 CISC101
1/7/2016
Today
ENIAC, Cont.
Take some of the MAGIC out of how computers
work:
See the video (that did not play last time!) at:
http:/www.youtube.com/watch?v=goi6NAHMKog
How did the technology get to where it is today?
ENIAC movie (
Winter 2016 CISC101
1/14/2016
Today
Disassembly Experiment
Go over the Python disassembly experiment
again.
Python has a module called dis that can show
you the assembly language version of a Python
line of code, function, object or an entire module.
A