Loai Tawalbeh Lecture - PowerPoint PPT Presentation

About This Presentation
Title:

Loai Tawalbeh Lecture

Description:

... Operation Decoding. Microprocessor instruction decoding. other fields ... decoded instructions. cpe 252: Computer Organization. 5. 2-to-4-decoder logic diagram ... – PowerPoint PPT presentation

Number of Views:19
Avg rating:3.0/5.0
Slides: 24
Provided by: alexandret
Category:

less

Transcript and Presenter's Notes

Title: Loai Tawalbeh Lecture


1
Loai Tawalbeh Lecture 2
Digital Logic Review
  • Standard combinational modules
  • decoders, encoders and
  • Multiplexers

1/3/2005
2
Decoders
  • General decoder structure
  • Typically n inputs, 2n outputs
  • 2-to-4, 3-to-8, 4-to-16, etc.

3
Binary 2-to-4 decoder
Note x (dont care) cases.
4
Decoder Use Operation Decoding
  • Microprocessor instruction decoding

opcode field
instruction
other fields
4-input binary decoder
1
En
0 1 2 . 15
jump
load
decoded instructions
store
add
5
2-to-4-decoder logic diagram
6
3-input Binary Decoder
Inputs x (x2, x1, x0), with xi in 0,1
and E in 0,1 Outputs y
(y7,y6,y5,,y1,y0) with yi in 0,1 Function
yi E. mi(x), i 0,1,,7
7
Implementing functions using a Binary Decoder and
OR Gates
Function
Remember that any function can be represented as
a sum of minterms
8
Binary Encoders
  • Only one input Ij has value 1 at any given time
  • Output Y corresponds to the binary code of j
    when Ij 1

9
8-to-3 Binary Encoders
Y0 I1 I3 I5 I7 (odd
input indices) Y1 I2 I3 I6 I7 Y2 I4
I5 I6 I7 (indices gt 3)
10
Multiplexers
data inputs
0 1 2 3
MUX
1 0
selection inputs
11
4-input Multiplexer
12
Typical Multiplexer use
selection between multiple paths to a functional
unit
13
Multiplexers as universal modules
  • Universal module using only this module you are
    able to implement ANY logic function.
  • NAND and NOR gates for example are universal
    gates.
  • Question how do you assign inputs for the
    multiplexer in order to implement a given
    function?

14
Exercise
Implement the following function using a)
8-input multiplexer. b) 4-input multiplexer.
F?x,y,z(1,2,6,7)
15
Loai Tawalbeh Lecture 2
Digital Logic Review
  • Signed and Unsigned Numbers

16
4-bit Unsigned Numbers
Range of values for n-bit vector is
0 x (2n-1)
17
Representation of Signed Integers and Basic
Operations
  • Two common representations
  • Sign and Magnitude (SM)
  • True and Complement (TC)
  • In both cases there is a mapping from signed
    values to positive values.

18
Sign and Magnitude
  • x represented by a pair (s,m) where
  • s is the sign 0 for positive and 1 for negative
  • m is the magnitude
  • example (-23)10 -(10111) (1,10111)
  • Range of values for n-bit vector (n-1 bits for m)
  • - (2n-1 1) x (2n-1 1)
  • Two representations for zero

19
2s complement
  • No separation between sign and magnitude
  • Signed integer x represented by positive integer
    xR such that
  • Example n4, 2416. To represent x -7 xR 9
  • Range of values for n-bit vector ( 2s comlement)
  • - (2n-1 ) x (2n-1 1)

20
4-bit Twos Complement Numbers
21
Change of Sign
  • complement each bit of x
  • add 1
  • Example n 4 x (0011)2 3
  • x 1100
  • 1
  • 1101 ?
    representation of -3

22
Positive integer addition/subtraction
23
Twos complement addition/subtraction
  • Addition same as positive integer addition
  • just discard carry out
  • Subtraction x - y
  • step 1 change the sign of y to obtain -y
  • step 2 add x and -y
  • Example x 8, y 5, 5-bit vectors

y 00101 -y 11011 ltltlt change
sign x - y 01000 11011
00011 ltlt carry out discarded
Write a Comment
User Comments (0)
About PowerShow.com