






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







Extender, Comparator, Hex-To-7-Segment Decoder/Driver, 8-bit ASU
ECE 371: Microprocessor Systems
Department of Electrical and Computer EngineeringSchool of Engineering, Mathematics, and Science
Purdue University – Calumet
How does one increase the number of bits of a binarynumber while preserving its sign (positive/negative)?–
Sign Extension
-^
To sign-extend an
m
-bit 2’s comp. number to
n-
bits (m < n), append
the sign bit to the MSB end until the
m
-bit number contains
n
bits.
10
(8-bits) = 0xEF
16
= 1110 0000
2
What about unsigned numbers?–
Zero Extension
-^
To zero-extend an
m
-bit unsigned number to
n-
bits (m < n), append
zeros to the MSB end until the number contains
n
bits.
10
(16-bits) = 0x
FF
EF
16
= 1111 1111
^1
110 0000
2
32
10
(8-bits) = 0x
16
= 0010 0000
2
32
10
(16-bits) = 0x
00
20
16
= 0000 0000
0010 0000
2
Using Ripple Carry Organization
4 τ
6 τ
Assumptions •^
1 τ
gate delay for AND/OR Gates
-^
2 τ
gate delay for XOR Gates
-^
p(Ai
,Bi
) = Ai
XOR Bi
8 τ i
6 τ
add, and another for sub.
Available VHDL Packages
-^
std_logic_
-^
Defines
STD_LOGIC
and
STD_LOGIC_VECTOR
types
numeric_std
std_logic_arith
Focus Here!
Link
:^
http://www.csee.umbc.edu/help/VHDL/stdpkg.html
std_logic_unsigned
std_logic_signed
-^
numeric_bit
math_real
math_complex
Focus Here!
Defines numeric types and arithmetic functions^ •
: represents unsigned
number in vector form
based on base element type
: represents a signed
number in vector form
based on base element type
The leftmost bit is treated as the most significant bit.
-^
The leftmost bit is treated as the most significant bit.
-^
Signed vectors are represented in two's complement form.
-^
Operators
Functions
ABS(), REM(), MOD(), SHIFT_LEFT(), SHIFT_RIGHT(),
ROTATE_LEFT(), ROTATE_RIGHT(), RESIZE(), TO_INTEGER(),TO_UNSIGNED(), TO_SIGNED(), TO_STDLOGICVECTOR(), NOT(),AND(), OR(), AND(), NOR(), NAND(), XOR(), XNOR(), STD_MATCH()
Link
:^
http://www.csee.umbc.edu/help/VHDL/stdpkg.html
Provides unsigned
numerical computation capabilities on
type
types as unsigned numbers
Operators
Functions
Functions
Provides signed
numerical computation capabilities on
type
types as signed numbers
Operators
Functions
Link
:^
http://www.csee.umbc.edu/help/VHDL/stdpkg.html
The
keyword is used to map an unused output (does
not work for input, why?) port of an instantiated module
-^
Input ports cannot be left “open”.^ •
If an input port does not require mapping, connect it to GND or VCCvia VHDL
CONSTANTS
or literals.
Example
:^ Output ports
G
and
P
of both CLAs not used. Use
OPEN
to
connect the ports.connect the ports.
LSB_CLA_4bit : CLA_4bit PORT MAP
(, ,
, GroupGen =>
OPEN
, GroupProp =>
OPEN
);