Docsity

IEEE Std. 1076.3 Synthesis Libraries: Numeric_std and Arithmetic Operations - Prof. Victor, Study notes of Electrical and Electronics Engineering

Toggle sidebar
bg1
IEEE Std. 1076.3 Synthesis Libraries
IEEE Std. 1076.3 Synthesis Libraries
Text: Chap 10.12, 12.6.5, 12.6.9
Text: Chap 10.12, 12.6.5, 12.6.9
๎š„
๎š„numeric_std
numeric_std
๎š„
๎š„defines types UNSIGNED and SIGNED as arrays of
defines types UNSIGNED and SIGNED as arrays of
std_logic
std_logic
type SIGNED is
type SIGNED is array(NATURAL
array(NATURAL range <>) of STD_LOGIC;
range <>) of STD_LOGIC;
type UNSIGNED is
type UNSIGNED is array(NATURAL
array(NATURAL range <>) of STD_LOGIC;
range <>) of STD_LOGIC;
๎š„
๎š„defines standard arithmetic and relational operators on
defines standard arithmetic and relational operators on
these types
these types
๎š„
๎š„numeric_bit
numeric_bit
๎š„
๎š„same as above except SIGNED/UNSIGNED are arrays of
same as above except SIGNED/UNSIGNED are arrays of
bit
bit
๎š„
๎š„std_logic_arith
std_logic_arith
(from Synopsis)
(from Synopsis)
๎š„
๎š„Non
Non-
-standard predecessor
standard predecessor of
of numeric_std
numeric_std/bit
/bit
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download IEEE Std. 1076.3 Synthesis Libraries: Numeric_std and Arithmetic Operations - Prof. Victor and more Study notes Electrical and Electronics Engineering in PDF only on Docsity!

IEEE Std. 1076.3 Synthesis Libraries

IEEE Std. 1076.3 Synthesis Libraries

Text: Chap 10.12, 12.6.5, 12.6.

Text: Chap 10.12, 12.6.5, 12.6.

ย„ ย„

numeric_std

numeric_std

ย„ ย„

defines types UNSIGNED and SIGNED as arrays of defines types UNSIGNED and SIGNED as arrays of

std_logic std_logic

type SIGNED is type SIGNED is

array(NATURAL array(NATURAL

range <>) of STD_LOGIC; range <>) of STD_LOGIC;

type UNSIGNED is type UNSIGNED is

array(NATURAL array(NATURAL

range <>) of STD_LOGIC; range <>) of STD_LOGIC;

ย„ ย„

defines standard arithmetic and relational operators on defines standard arithmetic and relational operators on

these types these types

ย„ ย„

numeric_bit

numeric_bit

ย„ ย„

same as above except SIGNED/UNSIGNED are arrays of same as above except SIGNED/UNSIGNED are arrays of

bit bit

ย„ ย„

std_logic_arith

std_logic_arith

(from Synopsis)

(from Synopsis)

ย„ ย„

Non Non-

standard predecessor standard predecessor

of of

numeric_std numeric_std

/bit /bit

NUMERIC_STD package contents NUMERIC_STD package contents

ย„ ย„

Arithmetic functions: +

Arithmetic functions: + -

rem

rem

mod

mod

ย„ ย„

Combinations of operands allowed: Combinations of operands allowed:

ย„ ย„

SIGNED + SIGNED return SIGNED SIGNED + SIGNED return SIGNED

ย„ ย„

SIGNED + INTEGER return SIGNED SIGNED + INTEGER return SIGNED

ย„ ย„

INTEGER + SIGNED return SIGNED INTEGER + SIGNED return SIGNED

ย„ ย„

6 relational operators for above operands

6 relational operators for above operands

ย„ ย„

TO_INTEGER(signed

TO_INTEGER(signed),

), TO_SIGNED(integer,#bits

TO_SIGNED(integer,#bits)

ย„ ย„

RESIZE(signed,#bits

RESIZE(signed,#bits)

  • changes # bits

changes # bits

ย„ ย„

SHIFT_LEFT/RIGHT, ROTATE_LEFT/RIGHT

SHIFT_LEFT/RIGHT, ROTATE_LEFT/RIGHT

ย„ ย„

+ all of above with UNSIGNED/NATURAL

+ all of above with UNSIGNED/NATURAL

library IEEE; use IEEE.STD_LOGIC_1164.all;use IEEE.NUMERIC_STD.all;entity Adder4 is

port ( in1, in2 : in

STD_LOGIC_VECTOR(3 downto 0) ;

mySum : out

STD_LOGIC_VECTOR

(3 downto 0) ) ;

end Adder4;architecture Behave_B of Adder4 isbegin

mySum <=

STD_LOGIC_VECTOR(SIGNED(in1) + SIGNED(in2));

end Behave_B;

Type conversions

Conversion of

Conversion of โ€œ

โ€œclosely

closely-

related

relatedโ€

โ€ types

types

arrays of same dimension + elements of same type

Modeling Finite State Machines Modeling Finite State Machines

(Synchronous Sequential Circuits)

(Synchronous Sequential Circuits)

ย„ ย„

FSM design & synthesis process:

FSM design & synthesis process:

Design state diagram (behavior)

Design state diagram (behavior)

Derive state table

Derive state table

Reduce state table

Reduce state table

Choose a state assignment

Choose a state assignment

Derive output equations

Derive output equations

Derive flip

Derive flip

flop excitation equations

flop excitation equations

ย„ ย„

Synthesis steps 2

Synthesis steps 2-

6 can be automated,

6 can be automated,

given the state diagram

given the state diagram

Synchronous Sequential Circuit Synchronous Sequential Circuit

(FSM) Example

(FSM) Example

B/0C/

A/

X

/Z

Present

state

Input

x

Next state/output

A/

A/

C/

A B

C

A

B

C

FSM Example

FSM Example

entity definition

entity definition

entity

entity

seqckt

seqckt

is

is

port (

port (

x: in bit;

x: in bit;

FSM input

FSM input

z: out bit;

z: out bit;

FSM output

FSM output

clk

clk

: in bit );

: in bit );

clock

clock

end

end

seqckt

seqckt

FSM Example

FSM Example

continued

continued

Model the next Model the next

state and output functions of the FSM state and output functions of the FSM

process (x, process (x,

pres_state pres_state

function inputs function inputs

begin begin

case case

pres_state pres_state

is is

describe each state describe each state

when A => if (x = when A => if (x =

) then) then

z <= z <=

next_state next_state

<= A;

<= A;

else else

(x = (x =

z <= z <=

next_state next_state

<= B;

<= B;

end if; end if;

(continue next slide for (continue next slide for

pres_state pres_state

= B and C) = B and C)

FSM Example (continued)

FSM Example (continued)

when B => if (x= when B => if (x=

โ€˜ โ€˜

0 0

โ€™ โ€™

) then) then

z <= z <=

โ€˜โ€˜

00

โ€™ โ€™

; ;

next_state next_state

<= A; <= A;

else else

z <= z <=

โ€˜โ€˜

11

โ€™ โ€™

; ;

next_state next_state

<= C; <= C;

end if; end if;

when C => if (x= when C => if (x=

โ€˜ โ€˜

0 0

โ€™ โ€™

) then ) then

z <= z <=

โ€˜โ€˜

00

โ€™ โ€™

; ;

next_state next_state

<= C; <= C;

else else

z <= z <=

โ€˜โ€˜

11

โ€™ โ€™

; ;

next_state next_state

<= A; <= A;

end if; end if;

end case; end case;

end process; end process;

end; end;