Post on 29-Sep-2020
0.1
Welcome to CENG!
http://blog.tmcnet.com/blog/rich-tehrani/uploads/facebook-datacenter-electrical-large.jpghttp://www.cmu.edu/news/image-archive/Boss.jpghttp://prisonerofclass-5933.zippykid.netdna-cdn.com/wp-content/uploads/2013/05/iphone.jpghttp://firstcallappliance.com/wp-content/uploads/image/microwave.jpghttp://www.engadget.com/2011/02/19/intel-to-spend-5-billion-on-new-14nm-fab-in-arizona-creating-4/https://www.staples-3p.com/s7/is/image/Staples/s0978329_sc7?$splssku$http://www.spacex.com/sites/spacex/files/spacex_default.jpg
0.2
What is Computer Engineering
• Computer Engineering is…
– Developing efficient systems that combine hardware,
software, and networking to interact with the physical
world and/or solve information-based problems
– Learning how to design, analyze, implement, and test such
systems
Goal of CECS/CENG: To develop engineers who can span the complex inter-relationship of computer hardware and software, creating and designing system solutions
0.3
Today's Digital Environment
Voltage / Currents
Transistors / Circuits
Digital Logic
Processor / Memory / GPU / FPGAs
Assembly / Machine Code
OS /Libraries
C++ / Java / Python
Algorithms
Voltage / Currents
Transistors / Circuits
Digital Logic
Processor / Memory / GPU / FPGAs
Assembly / Machine Code
OS /Libraries
C++ / Java / Python
Algorithms
Networks
Applications
0.4
Computer Engineering as Abstraction Levels
SW
Controlling Input
(Gate )
Output (Drain )
Source
Fx
y
z
+B
A
S
if (x > 0) thenx = x + y - z;
a = b*x;
Transistors
LogicAND gate
Functional Units
Chips(Processors)
Software Code
--
--
--
-
1110010101…
Voltage / Currents
Transistors / Circuits
Digital Logic
Processor / Memory / GPU / FPGAs / Networks
Assembly / Machine Code
OS /Libraries
C++ / Java / Python
Algorithms
Networks
Applications
HW
0.5
You Can Do That With Computer Engineering
SW
Voltage / Currents
Transistors / Circuits
Digital Logic
Processor / Memory / GPU / FPGAs / Networks
Assembly / Machine Code
OS /Libraries
C++ / Java / Python
Algorithms
Networks
Applications
HW
Devices & Integrated Circuits
(Semiconductors & Fabrication)
Architecture(Processors & Embedded
HW)
Systems & Networking(Embedded Systems, IoT,
Networks)
Applications(AI, Robotics, Graphics, Mobile)
Cloud & Distributed Computing(CyberPhysical, Databases, Data Mining, Machine Learning, etc.)
0.6
Goals of this Course
SW
Voltage / Currents
Transistors / Circuits
Digital Logic
Processor / Memory / GPU / FPGAs / Networks
Assembly / Machine Code
OS /Libraries
C++ / Java / Python
Algorithms
Networks
Applications
HW
• Embedded Systems
• Programming
– C language
• Digital logic
– Hardware design
• Computer Performance
– Understanding and
improving performance of
systems
• Electronics
– Voltage, current, basic
circuit theory
Embedded
0.7
Full Timeout - Syllabus
0.8
Course Advice
• Catch the wave!
– Start early and lay a good foundation in the
first few weeks (even on the "easy" stuff)
– Don’t let shame or embarrassment keep
you from the help you need
• Put in the time
– Achieving mastery takes ______ hours?1
• Play!
– Be active, curious, and engaged
• Don't let "class" get in the way of learning
– Do not be afraid to just try, even if you fail
• Failure breeds far more learning than success1 From Malcolm Gladwell's Outliers
0.9
CECS Curriculum
EE 457
EE 454
EE 477
CS 170
CS 270
CS 350
CS 310
CS 360
CS 420
CS 445
EE 459CS 477
Core Concepts(Programming Languages,
Data Structures,Digital Logic Design)
Operating Systems
Software Engineering
Algorithms, Theory, Cryptography
Graphics
AI
Robotics
Integrated Circuits
EE 479
Computer Architecture
CS 353
Networks & Web Programming
EE 354
CS103
CS 104
CS 201
EE109
EE 250
EE 451
CS 476
0.10
EE Curriculum
EE/CS109
EE 354
Core Classes
Computer Engineering Electrical Sciences
EE 155 EE 250 EE 301 EE 364 EE 202 EE 330
Programming Embedded Systems
IoT Linear Systems
Probability and Statistics
Linear Circuits Electromagnetics
EE 457
EE 454
EE 451
EE 450
CS 445CS 360
CS 350
EE 459
EE 477
Digital System Design
Operating Systems
Networks
Computer Architecture
Intro. To System-on-Chip
Intro. To VLSIParallel & Distributed Computing
RoboticsAI
Capstone
Circuits, Signals, and Systems
Area Electives
EE 355
Software Design
0.11
Careers
• Information Technology
• General & High Performance Computing
• Mobile and Networking
• Media & Entertainment
• Automotive
• Robotics
• Aerospace / Defense
0.12
Careers
… and presidents of USC. Our last two presidents, Steven
Sample and Max Nikias were both Electrical Engineers.
0.13
Companies
• Information Technology
• Semiconductor & General computing
• Telecomm and Networking
• Media & Entertainment
• Automotive
• Robotics
• Aerospace
• Startups
• Facebook, Apple, Google, MS
• Intel, IBM
• Qualcomm, Cisco
• EA, Disney, Riot Games
• Ford, Uber, etc.
• JPL, iRobot
• SpaceX, Boeing, Raytheon
• Embark (now Apple), Zboard
2 of the top 10 fastest-growing job markets will be Computer Science and System (CENG) Engineers
* U.S. Department of Labor
0.14
Research/Extracurriculars at USC
• Autonomous Networks Research Group
– Wireless & mobile networks, embedded
sensing and processing
• Information Sciences Institute
– AI, Internet, Advanced Processing Systems research
• Institute for Creative Technologies
– Virtual Reality, Graphics, Animation, Games
• Student Orgs
– Makers (http://viterbimakers.usc.edu/)
– HackSC, AthenaHacks, SparkSC
– IEEE, ACM
0.15
EMBEDDED SYSTEMS
0.16
Digital System Spectrum
• Key idea: Any “algorithm” can be implemented in HW or SW or some mixture of both
• A digital systems can be located anywhere in a spectrum of:
– ALL HW: (a.k.a. Application-Specific IC’s)
– ALL SW: An embedded computer system
• Advantages of application specific HW
– Faster, less power
• Advantages of an embedded computer system (i.e. general purpose HW for executing SW)
– Reprogrammable (i.e. make a mistake, fix it)
– Less expensive than a dedicated hardware system (single computer system can be used for multiple designs)
• One of the main points for the whole course:
– Applications and processing can be done in software, custom-designed HW, or some mixture of both
– Each one has pros/cons
– We will give you the knowledge for how it can be done in both
Co
mp
uti
ng
Syste
m
Sp
ectr
um
Application Specific Hardware
(no software)
General Purpose HW w/ Software
Fle
xib
ilit
y, D
es
ign
Tim
e
Pe
rfo
rma
nc
e
Co
st
http://www.xbitlabs.com/images/news/2008-06/nvda_tegra_chip_scheme.jpg
0.17
Processing Logic Approaches
• Custom Hardware – Logic that directly implements a
specific task
– Example above may use separate adders and a multiplier unit
• General Purpose (GP) Processor– Logic designed to execute SW
instructions
– Provides basic processing resources that are reused by each instruction
• What if I want to perform:– X*Y + A*B
– What's easiest to redesign?
+ *
Data storageInstruc.Store
ADD X,YADD A,BMUL X,A
GP Proc. Implementation of (X+Y)*(A+B)
+
+
*
X
Y
A
B
Out
Custom HW Implementation
0.18
Embedded Systems
• An embedded system is…
– A special purpose computer that is designed into a larger
device to perform some amount of dedicated tasks
• Utilize a microcontroller…
– Laptops or desktops contain a microprocessor
– Embedded systems contain microcontrollers
– What's the difference?
• Microprocessor is part of a larger computer system w/ RAM and
general purpose I/O
• Microcontroller is a single-chip with RAM and I/O to control
specific electro/mechanical devices
0.19
A Comparison
• Different microprocessor and microcontroller
based systemsPC
(Core i7)
iPhone
(A6 chip)
MIPS32
(PIC32MX…)
Arduino
(ATMega328)
Clock speed 3 GHz 1.3 GHz 80 MHz < 20 MHz
Data size 64-bits 32-bit 32-bits 8-bits
RAM 8 GB 1 GB 16 KB 2 KB
Storage 1 TB 32 GB 128 KB 32 KB
Cost $1,000 $650 $6.04 $2.88
0.20
Engineering Design
Engineering is
Design with Constraints
0.21
Engineering Design
Artist: “We’ll create a spaceship powered by a warp drive.”
Engineer: “We need to build a rocket engine that works.”
Artists and engineers both design things, but differently.
0.22
What constraints does an engineer face when designing something?
Engineering Design
0.23
What constraints does an engineer face when designing something?
Engineering Design
Cost Performance Reliability
Durability Ease of use Weight
Power Size Safety
Environmental Political Testability
0.24
The constraints may differ depending on the product.
Engineering Design
Toy: Cost > Reliability
Medical implant device: Reliability > Cost
0.25
APPLICATIONS & TOPICS
Examples we'll learn about throughout the semester
0.26
Decoders
• Decoders are digital circuits that help identify 1-of-N options.
• You might find one in a vending machine and many other
devices.
1 2 3
4 5 6
7 8 9
0
0 1 2 3
4 5 6 7
8 9 10 11
12 13 14 154-to-16 decoder
A[3:0]
0 1 2 3 … 15
0.27
Multiplexers
• Multiplexers ("muxes" for short) are digital circuits that help
select one data source and direct traffic in a digital system
• You will find them everywhere in digital systems, for example,
in network routers.
0.28
Controllers and State Machines
• State machines implemented in HW or SW help control many
devices
– You will learn how to design and implement them both in HW and SW
Small Street
Turn
Sensor
S1
Turn
Sensor
S2
Overall sensor
output
S = S1 + S2This Photo by Unknown Author is licensed under CC BY-NC-ND
0.29
Embedded Control
• You'll design and implement a stopwatch
with an LCD screen, buttons, etc.
• You'll learn about how to make
hardware devices display things,
measure time, make sounds, etc.
through our labs
0.30
Hardware Acceleration
• You'll see how hardware can be used to perform
audio, image, and video effects and why hardware is
needed to accelerate many of these operations
0.62 0.625 0.63 0.635 0.64 0.645 0.65 0.655 0.66 0.665 0.67-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.62 0.625 0.63 0.635 0.64 0.645 0.65 0.655 0.66 0.665 0.67-0.4
-0.3
-0.2
-0.1
0
0.1
0.2
0.3
0.4
Original signalHigh pitch tones removed after digital
HW filtering
0.31
Computer Processor Design
• You learn about how
computer processor
work and interact with
memory
• You'll learn about
caching and other
performance
improving techniques
0.32
COMPUTER ORGANIZATION
OVERVIEW
How does your computer work?
0.33
Computer Systems Tour
• How does a SW program get mapped and executed on a computer
• What components is a computer composed of and what are their functions
• How does the architecture affect performance
C / C++ / Java
Logic Gates
Transistors
HW
SW
Voltage / Currents
Assembly / Machine Code
Applications
LibrariesOS
Processor / Memory / I/O
Functional Units(Registers, Adders, Muxes)
Start Here
End Here
0.34
Software Process
1110 0010 0101 10010110 1011 0000 11000100 1101 0111 11111010 1100 0010 10110001 0110 0011 1000
MOVE.W X,D0CMPI.W #0,D0BLE SKIPADD Y,D0SUB Z,D0
SKIP MUL …
Software Program
High Level Language
Description
Assembly (.asm/.s files)
Executable Binary Image
if (x > 0)x = x + y - z;
a = b*x;
LA $t0,xLW $t1,0($t0)BLE $t1,$zero,SKIPLA $t0,yLW $t2,0($t0)LA $t0,zLW $t3,0($t0)ADD $t1,$t1,$t2SUB $t1,$t1,$t3
SKIP: MUL …
1110 0010 0101 10010110 1011 0000 11000100 1101 0111 11111010 1100 0010 10110001 0110 0011 1000
.c/.cpp files1110 0010 0101 10010110 1011 0000 11000100 1101 0111 11111010 1100 0010 10110001 0110 0011 1000
Object/Machine Code(.o files)
Preprocessor / Compiler Assembler
LinkerLoader / OS
Program Executing
A “compiler”(i.e. gcc, VisualC++,
etc.) usually performs all 3 steps
0.35
Hardware Components• Computer hardware can be
classified into three categories– Processor
• Performs operations on data
– Memory (RAM & ROM)• Stores data for processing
• Stores software code (instructions)
– Input/Output Devices• Supplies and consumes data
• Supplies the program
• Keyboard, Mouse, Monitor, Hard Drive
• Many variations due to different performance, cost, reliability, power factors
Processor
MemoryOutput Devices
Input Devices
Software Program
Data
0.36
Processor
• Performs the same 3-step process over and over again
– Fetch an instruction from memory
– Decode the instruction• Is it an ADD, SUB, etc.?
– Execute the instruction• Perform the specified operation
• This process is known as the Instruction Cycle
Processor
Memory
ADD
SUB
CMP
ArithmeticCircuitry
DecodeCircuitry
1 Fetch Instruction
It’s an ADD
Add the specified values
2
3
Wires
connecting
the processor
and memory
devices
0.37
Memory
• Set of cells that each store a group of bits
– Usually, 1 byte (8 bits) per cell
• Unique address (number) assigned to each cell
– Used to reference the value in that location
• Data and instructions are both stored in memory and are always represented as a string of 1’s and 0’s
11010010
01001011
10010000
11110100
01101000
11010001
…
00001011
0
1
2
3
4
5
FFFF
Address Data
Memory Device
0.38
Memory Operations
• Memories perform 2 operations– Read: retrieves data value in a
particular location (specified using the address)
– Write: changes data in a location to a new value
• To perform these operations a set of address, data, and controlwires are used to talk to the memory– Note: A group of wires/signals is
referred to as a ‘bus’
– Thus, we say that memories have an address, data, and control bus.
11010010
01001011
10010000
11110100
01101000
11010001
…
00001011
0
1
2
3
4
5
FFFF
11010010
01001011
10010000
11110100
01101000
00000110
…
00001011
0
1
2
3
4
5
FFFF
2
10010000
Read
Addr.
Data
Control
Addr.
Data
Control
5
00000110
Write
A Write Operation
A Read Operation
Processor
Processor
System Bus (address, data, control wires)
0.39
Memory Types
• RAM (Random Access Memory)
– Volatile: Contents are lost on power-off
– RAM usually refers to memory that can both be read
and written quickly
• Flash/ROM (Read-Only Memory)
– Data values are programmed prior to shipping and
cannot be rewritten by the processor
– Non-volatile: Contents are retained w/o power
0.40
Input / Output• Keyboard, Mouse, Display, USB devices, Hard Drive, Printer, etc.
• Processor can perform reads and writes on I/O devices just as it does on memory– I/O devices have locations that contain the processor can access
– These locations are assigned unique addresses just like memory
– The value in these locations is the input data or output data that will control the device
Keyboard Interface
‘a’ = 61 hex in ASCII
61400
Processor Memory
A D C
400
61
READ
…
0
399
0.41
Input / Output
• Writing a value to the video adapter can set a pixel on the screen
Video Interface
FE may signify a
white dot at a particular
location
…
800
Processor Memory
A D C
800
254
WRITE
…
0
399
254
01
Keyboard Interface
61400
0.42
Amazon Echo
• Let's try to put all of this into context with an
example
• Let's see what hardware is inside
• Let's think about some of the software
considerations
Many of the terms you see may not be familiar but you will learn about many of them throughout this
course. By the end of the semester you should have a good idea of what is going on inside!
For now, focus on the categorization of processor, memory, and I/O and how they must talk to each
other by doing reads/writes.
0.43
Amazon Echo Hardware [1/3]
• Main Processing board
– [Red] Texas Instruments DM3725CUS100 Digital Media Processor
– [Orange] Samsung K4X2G323PD-8GD8 256 MB LPDDR1 RAM
– [Yellow] SanDisk SDIN7DP2-4G 4 GB iNAND Ultra Flash Memory
– [Green] Qualcomm Atheros QCA6234X-AM2D Wi-Fi and Bluetooth
Module
– [Blue] Texas Instruments TPS65910A1 Integrated Power Management
IC
https://www.ifixit.com/Teardown/Amazon+Echo+Teardown/33953
You will learn more about
how the processor
and memory are designed.
0.44
Amazon Echo Hardware [2/3]
• Daughterboard with much of the audio I/O devices– [Red] Texas Instruments LP55231 Programmable 9-Output LED Driver (x4)
– [Orange] Texas Instruments TLV320ADC3101 92dB SNR Low-Power Stereo ADC
(x4)
– [Yellow] Texas Instruments SN74LVC74A Dual Positive-Edge-Triggered D-Type
Flip-Flops
– [Green] S1053 0090 V6 Microphone (x7)
https://www.ifixit.com/Teardown/Amazon+Echo+Teardown/33953
In your first few labs you will build systems to control
LEDs, perform A-to-D conversions
(ADC), and learn about "flip-flops"
0.45
Amazon Echo Hardware [3/3]
• Power and speaker I/O board
– [Red] Texas Instruments TPS53312, likely an updated version of
the TPS53311 3A Step-Down Regulator with Integrated Switcher
– [Orange] Texas Instruments TLV320DAC3203 Ultra Low Power Stereo
Audio Codec
– [Yellow] Texas Instruments TPA3110D2 15W Filter-Free Class D Stereo
Amplifier
https://www.ifixit.com/Teardown/Amazon+Echo+Teardown/33953
Not everything is digital. To produce audible sound we need to worry about voltage/current
requirements.
0.46
Amazon Echo Software
• What kind of software do we need?
– Firmware: Software that won't often change and
is meant to control the hardware
• Low-level software to control the various hardware
devices (speakers, microphones, etc.)
• Operating system to run and coordinate all the higher
level software apps
• Audio processing software to perform voice
recognition, etc.
– Extensible framework for higher level, networked
software that may perform new user-defined
skills/apps
0.47
Amazon Echo Software
• Some tasks may be
handled by the
hardware/software in the
Echo
– Recognition of "Alexa"
voice command
• Other requests may
require more information
or processing capability
than is locally present so
it is sent over the
Internet to be processed
in the cloud
https://developer.amazon.com/alexa-skills-kit
"Alexa"
0.48
Reminders
• Take the survey linked on our website under
the Lecture Schedule…Lecture 1
• Attend lab and bring your laptops
• Get the course reader at the book store
• Watch the pre-lecture video on Circuits before
coming to our next lecture