Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

CS M51A/EEM51A Spring’15 Section 1

Logic Design of Digital Systems


Lecture 2
April 1, 2015

Yutao He
yutao@cs.ucla.edu
4532B Boelter Hall
https://ccle.ucla.edu/course/view/15S-COMSCIM51A-1
http://piazza.com/ucla/spring2015/csm51a/home

CSM51A/EEM16-Sec.1 S 14 L2.1 Y. He @ 4/1/15

Outline

•  Administrative Matter
•  Ch 1 Recap
•  Ch 2.1,2.2 - High-Level Spec. of Comb. Systems
•  Ch 2.3 - Data Representation and encoding
•  Summary

CSM51A-Sec1 S 15 L2.2 Y. He @ 4/1/14


Administrative Matter
•  PTE numbers:
–  Will be issued by Thursday
–  If you haven t filled in a questionnaire, please do so
•  Homework #1:
–  HW#1 is due at 5pm on Monday, April 6
–  Drop off box is A4 in the TA Consultation Room (BH 2432)
–  Cover sheet must be attached to your work
–  Please do not write the name or SID in any other pages

CSM51A-Sec1 S 15 L2.3 Y. He @ 4/1/14

Recap - Big Picture of the Class


Idea

Specification

Logic Design Problem Solving Idea #1:


Divide-and-Conquer
Physical Design

Fabrication

CSM51A-Sec1 S 15 L2.4 Y. He @ 4/1/14


Recap - Big Picture of the Class
(Hardware) Systems

Analog

Digital

System
Comb. Sync.
Logical
Seq. Async. Circuit

Logic Design

Function
Inputs Number Systems
Outputs
Specification Boolean Algebra Implementation
K-Map
Truth Table
CAD Tools

CSM51A-Sec1 S 15 L2.5 Y. He @ 4/1/14

Chapter 2 - Overview

English Arithmetic Function


Schematic
Text Expression Table

High Level Arithmetic

Specification:
What It Does?

Binary Level Logic

Switching Truth
K-Map VHDL
Expression Table

CSM51A-Sec1 S 15 L2.6 Y. He @ 4/1/14


High-Level Spec - Word Problem

•  Goal:
–  Given a high-level specification of some forms, design a
digital system.
•  Basic approach:
–  Ask three questions:
•  What are inputs?
•  What are outputs?
•  What are the relationships between inputs and outputs

Inputs Function Outputs

CSM51A-Sec1 S 15 L2.7 Y. He @ 4/1/14

Word Problem - Example 1

•  Description:
–  Design a digital system that computes the distance between
two 1 s in a four-binary-digit number.
–  Assume that a number contains exactly two 1 s.

Inputs System distance

A combinational system

CSM51A-Sec1 S 15 L2.8 Y. He @ 4/1/14


Example 1 - Cont.
Inputs Distance

0000 -
0001 -
0010 -
0011 0
0100 -
0101 1
0110 0
0111 -
1000 -
1001 2
1010 1
1011 -
1100 0
1101 -
1110 -
1111 -

CSM51A-Sec1 S 15 L2.9 Y. He @ 4/1/14

Word Problem - Example 2

•  Description:
–  A single light can be controlled by any one of three switches.
Design a digital system that controls the light as follows:
•  One switch is the master on/off switch. If it is down, the light is
off.
•  When the master switch is up, a change in the position of one of
other switches causes the light to change.

Switches System Light

A sequential system

CSM51A-Sec1 S 15 L2.10 Y. He @ 4/1/14


Example 2- Cont.

Switches Lights

DDD Off
DDU Off
DUD Off
DUU Off
UDD Off On
UDU On Off
UUD On Off
UUU Off On

•  Note, the function table IS incomplete. We’ll cover a better way


to specify the sequential system in Chapter 7

CSM51A-Sec1 S 15 L2.11 Y. He @ 4/1/14

Data Representation

Data Symbols Number Unit of a


Systems Datum

Alphabet
Character 0, …, 9 Decimal Digit
Real World

Digital World
0, 1 Binary Bit
Number

•  Some common terms for binary data:


–  nibble = 4 bits
–  byte = 8 bits (a.k.a. octet)
–  word = 32 bits

CSM51A-Sec1 S 15 L2.12 Y. He @ 4/1/14


Representation of Characters
•  ASCII Code
–  7 Bits
–  128 characters: alphabet, numbers, punctuation, control
characters
•  EBCDIC
–  8 Bits, 256 characters
–  invented by IBM and used in its mainframes

•  UniCode
–  16 Bits
–  65,536 characters
–  aimed to support the interchange, processing, display texts
written in different languages
CSM51A-Sec1 S 15 L2.13 Y. He @ 4/1/14

ASCII Code Table

CSM51A-Sec1 S 15 L2.14 Y. He @ 4/1/14


Encoding/Decoding of Characters

•  Question:
–  Given a string of 0 s and 1 s, find the meaning it represents

•  Solution:
–  find its encoding scheme
–  chop the string at the boundary
–  look up the corresponding table

•  Example:
–  What does 00110110 stand for?

CSM51A-Sec1 S 15 L2.15 Y. He @ 4/1/14

Number Systems
•  Definition
–  A writing system or a mathematical notation for representing
numbers of a given set, using a set of symbols in a
consistent manner
•  Properties
–  Represent a useful set of numbers (e.g. all integers, or
rational numbers)
–  Give every number represented a unique representation (or
at least a standard representation)
–  Reflect the algebraic and arithmetic structure of the numbers

CSM51A-Sec1 S 15 L2.16 Y. He @ 4/1/14


Types of Number Systems
•  Sign-value
–  Represents numbers by a series of numeric signs that added
together equal the number represented
–  For example
•  Roman numerals
•  Unary System (base-1)
–  The simplest
–  Used for game-counting

•  Place-value
–  aka positional number systems
–  is a method of representing or encoding numbers by using
the same symbol for the different orders of magnitude

CSM51A-Sec1 S 15 L2.17 Y. He @ 4/1/14

Common Place-Value Systems

•  Binary System (base-2)


•  Decimal System (base-10)
–  Originated from arabic number system
–  Most commonly used in the world
•  Sexagesimal System (base-60, Babylonian system)

CSM51A-Sec1 S 15 L2.18 Y. He @ 4/1/14


Positional Number Systems

Positional
Number Number
Systems

Radix
Positive Integer
.
Negative Fraction

Mixed. Negative
Fixed Positive

CSM51A-Sec1 S 15 L2.19 Y. He @ 4/1/14

Positional Number Systems


n-1
•  Basic Formula: a = Σ A i× W i and W i= W i-1× Ri-1where
W0=1 i=0

–  How about fixed-radix systems, say binary number systems?


•  Some useful binary constants
10
–  (1,024)10= 2 - Kilo in binary systems
20
–  (1,048,576)10= 2 - Mega in binary systems
30
–  (1,073,741,824)10= 2 - Giga in binary systems
40
–  (1,099,511,627,776) = 2 - Tera in binary systems
10
–  250 - “Peta” in binary systems
–  260 - “Exa” in binary systems
–  270 - “Zetta” in binary systems

CSM51A-Sec1 S 15 L2.20 Y. He @ 4/1/14


Positional Number Systems (Cont.)

•  How many bits N are required to represent a decimal


value X?
N = log X , where N and X are decimal values
10

CSM51A-Sec1 S 15 L2.21 Y. He @ 4/1/14

Common Codes for Decimal Digits

Decimal Digit BCD Excess-3 Gray

0 0000 0011 0000


1 0001 0100 0001
2 0010 0101 0011
3 0011 0110 0010
4 0100 0111 0110
5 0101 1000 0111
6 0110 1001 0101
7 0111 1010 0100
8 1000 1011 1100
9 1001 1100 1101

CSM51A-Sec1 S 15 L2.22 Y. He @ 4/1/14


Encoding In Action – Binary Clock

CSM51A-Sec1 S 15 L2.23 Y. He @ 4/1/14

Encoding In Action – Keypad

Row 1
Row 2
Row 3
Row 4
Col 1
Col 2
Col 3
Common

1 2 3

4 5 6

C
7 8 9

* 0 #

CSM51A-Sec1 S 15 L2.24 Y. He @ 4/1/14


Encoding In Action – 1st Message in Internet

! d l o h e b sp d n a sp o l
lo and behold!

CSM51A-Sec1 S 15 L2.25 Y. He @ 4/1/14

Encoding In Action – QR Code

CSM51A-Sec1 S 15 L2.26 Y. He @ 4/1/14


Encoding In Action – Curiosity Wheel

CSM51A-Sec1 S 15 L2.27 Y. He @ 4/1/14

Number System Conversion


•  Basic Problem:
–  Convert the representation of a number in different number
systems
•  Basic Types:
–  Among number systems of different radices (bases)
•  Radix-10 to Radix-2
–  Between fixed-radix and mixed-radix number systems
•  Time in seconds and Time in H:M:S format

CSM51A-Sec1 S 15 L2.28 Y. He @ 4/1/14


Number System Conversion

Decimal
Formula Formula
(Radix 10)

Long Long
Division Division

Octal Long Hexdecimal


Formula
(Radix 8) Division (Radix 16)

bit grouping
bit grouping

Binary
digit expansion (Radix 2) digit expansion

CSM51A-Sec1 S 15 L2.29 Y. He @ 4/1/14

Number System Conversion (2)

•  Between fixed-radix and mixed-radix number systems

Formula

Mixed-radix Fixed-radix

Division

CSM51A-Sec1 S 15 L2.30 Y. He @ 4/1/14


Summary

•  Specification - Word Problem


•  Binary Data Representation
•  Number System Conversion

CSM51A-Sec1 S 15 L2.31 Y. He @ 4/1/14

Next Lecture

•  Sections 2.4, 2.5, App. A


–  Switching Functions and Expressions
–  Boolean Algebra

CSM51A-Sec1 S 15 L2.32 Y. He @ 4/1/14

You might also like