• 検索結果がありません。

フリップフロップ

N/A
N/A
Protected

Academic year: 2021

シェア "フリップフロップ"

Copied!
57
0
0

読み込み中.... (全文を見る)

全文

(1)

第3章 フリップ・フロップ

大阪大学 大学院情報科学研究科

今井 正治

[email protected]

(2)

講義内容

†

フリップ・フロップの基本原理

†

RSフリップ・フロップ

†

Dラッチ

†

Dフリップ・フロップ

†

JKフリップ・フロップ

†

Tフリップ・フロップ

†

まとめ

(3)

フリップ・フロップの基本原理(1/2)

†

帰還を持つインバータ回路(1個の場合)

„

スイッチング遅延(2 ns)を仮定

„

発振する

H

L

2

4

6

8

10 12 14 16

(4)

フリップ・フロップの基本原理(2/2)

†

帰還を持つインバータ回路(2個の場合)

„

2つの安定状態を持つ

†

インバータの個数と安定/発振の関係

„

奇数個の場合: 発振

„

偶数個の場合: 2つの安定状態を持つ

H

L

H

L

H

L

(5)

講義内容

†

フリップ・フロップの基本原理

†

RSフリップ・フロップ

†

Dラッチ

†

Dフリップ・フロップ

†

JKフリップ・フロップ

†

Tフリップ・フロップ

†

まとめ

(6)

RSフリップ・フロップ (RSFF)

†

MIL記号

„ 74279 (出力Qのみ) „ 4043 (NAND) „ 4044 (NOR)

†

動作表

R

Q

S

RSFF

Q

R

S

Q’

Q’

‘0’

Q

‘0’

‘1’

‘X’

‘1’

‘1’

‘0’

‘0’

‘1’

‘1’

‘X’

‘0’

Q

‘0’

‘1’

(7)

RSFFのNANDゲートによる実現

R

S

Q’

Q’

‘0’

Q

‘0’

‘1’

‘1’

‘1’

‘1’

‘0’

‘0’

‘1’

‘1’

‘1’

‘0’

Q

‘0’

‘1’

R

Q

S

Q

(8)

RSFFのNORゲートによる実現

R

S

Q’

Q’

‘0’

Q

‘0’

‘1’

‘0’

‘1’

‘1’

‘0’

‘0’

‘1’

‘1’

‘0’

‘0’

Q

‘0’

‘1’

S

Q

R

Q

(9)

RSFFのエンティティ記述

library IEEE; use IEEE.std_logic_1164.all; entity RSFF is generic( Tpd: time := 1 ns ); port( s_in: in std_logic; r_in: in std_logic; q_out: out std_logic; qb_out: out std_logic ); end entity RSFF;

(10)

RSFFのビヘイビア記述(1/2)

architecture BEHAVIOR of RSFF is begin

process( s_in, r_in ) begin

if s_in = '0' and r_in = '0' then NULL;

elsif s_in = '0' and r_in = '1' then q_out <= '0';

qb_out <= '1';

elsif s_in = '1' and r_in = '0' then q_out <= '1';

(11)

RSFFのビヘイビア記述(2/2)

else q_out <= 'X'; qb_out <= 'X'; end if; end process;

(12)

RSFFのデータフロー記述

(NANDゲートによる実装)

architecture DF_NAND of RSFF is

signal temp1, temp2: std_logic;

begin

temp1 <= ( not s_in ) nand temp2 after Tpd;

temp2 <= ( not r_in ) nand temp1 after Tpd;

q_out <= temp1;

qb_out <= temp2;

end architecture DF_NAND;

R

Q

S

(13)

RSFFのデータフロー記述

(NORゲートによる実装)

architecture DF_NOR of RSFF is

signal temp1, temp2: std_logic;

begin

temp1 <= r_in nor temp2 after Tpd;

temp2 <= s_in nor temp1 after Tpd;

q_out <= temp1;

qb_out <= temp2;

end architecture DF_NOR;

S

Q

R

(14)

RSFFの動作

Q

NAND

S

Q

NOR

Q

NOR

Q

NAND

R

set hold rst hold set inh hold rst inh hold ‘1’ ‘0’ ‘0’ ‘0’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ ‘0’ ‘0’ ‘0’ ‘0’ ‘0’ ‘0’ ‘0’ ‘0’ ‘0’ ‘0’ ‘1’ ‘0’ ‘0’ ‘0’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ ‘0’ ‘1’

(15)

RSFFへの「禁止入力」について

†

(S, R) = (‘1’, ‘1’) は「禁止入力」

†

(S, R) = (‘1’, ‘1’) が入力されると,出力は

(Q, Q) = (‘1’, ‘1’) または (‘0’, ‘0’) となる

†

禁止入力自体には大きな問題はない

†

むしろ,禁止入力の直後に(S, R) = (‘0’, ‘0’) が

入力されると回路が発振することが問題

(16)

講義内容

†

フリップ・フロップの基本原理

†

RSフリップ・フロップ

†

Dラッチ

†

Dフリップ・フロップ

†

JKフリップ・フロップ

†

Tフリップ・フロップ

†

まとめ

(17)

Dラッチ(D Latch)

†

MIL記号

„

7475, 7477 など

„

4042, 4508

†

真理値表

D

Q

G

D Latch

Q

G

D

Q’

Q’

‘0’

Q

Q

‘1’

‘0’

‘1’

‘1’

‘0’

‘0’

‘1’

‘1’

‘1’

‘0’

Q

‘0’

Q

別名: トランスペアレント・ラッチ

(18)

Dラッチの等価回路

G

Q

D

(19)

Dラッチの動作

①Gの値が‘1’の間,Dの値をそのまま出力する

(③Dの値は筒抜けになる)

②Gの値が‘1’から‘0’に変化すると,その時のDの値が保持される

D

Q

G

(20)

Dラッチのエンティティ記述

library ieee;

use ieee.std_logic_1164.all; entity D_LATCH is

generic( Tpd_lh: time := 2 ns; -- Rising Delay ( '0' to '1' ) Tpd_hl: time := 4 ns -- Falling Delay ( '1' to '0' ) );

port (

en: in std_logic; d_in: in std_logic; q_out: out std_logic );

(21)

Dラッチのビヘイビア記述 (1/2)

architecture BEHAVIOR of D_LATCH is begin

P1: process( en, d_in )

variable q_nxt: std_logic; begin

if en = '1' then q_nxt := d_in; end if;

(22)

Dラッチのビヘイビア記述 (2/2)

if q_nxt = '1' then q_out <= q_nxt after Tpd_lh; else q_out <= q_nxt after Tpd_hl; end if; end process P1;

(23)

Dラッチのデータフロー記述

architecture DATA_FLOW of D_LATCH is constant DELAY: time := 1 ns;

signal temp1, temp2, temp3, temp4: std_logic; begin

temp1 <= en nand d_in after DELAY; temp2 <= en nand not d_in after DELAY; temp3 <= temp1 nand temp4 after DELAY; temp4 <= temp2 nand temp3 after DELAY; q_out <= temp3;

(24)

講義内容

†

フリップ・フロップの基本原理

†

RSフリップ・フロップ

†

Dラッチ

†

Dフリップ・フロップ

†

JKフリップ・フロップ

†

Tフリップ・フロップ

†

まとめ

(25)

Dフリップ・フロップ(DFF)

†

MIL記号

„

7474, 74175 など

„

4013

†

CKの端子の△印は

エッジトリガー型である

事を表す

†

PR,CLRの○印は,

Low Activeである事を

表す

D Q CK

DFF

Q CLR PR

(26)

DFFの動作表

入力 出力

CLOCK D PRESET CLEAR Q

‘1’ ‘1’ ‘0’ Q ‘1’ ‘-’ ‘-’ ‘0’ ‘1’ ‘1’ ‘0’ ‘-’ ‘-’ ‘0’ ‘0’ ‘1’ ‘1’ ‘1’ ‘1’ ‘0’ ‘0’ ‘1’ ‘-’ ‘-’ Q ‘1’ ‘0’ ‘1’ ‘1’ Q ‘-’ ‘1’ ‘0’ ‘1’

(27)

DFFのエンティティ記述

library ieee; use ieee.std_logic_1164.all; entity DFF is port ( clock: in std_logic; pr_b: in std_logic; -- preset cl_b: in std_logic; -- clear d_in: in std_logic;

q_out: out std_logic; qb_out: out std_logic ); end entity DFF;

(28)

DFFのビヘイビア記述 (1/2)

architecture BEH_PE_ASR of DFF is begin

P1: process( clock, preset, clear ) variable q_nxt, qb_nxt: std_logic; begin if pr_b = ‘0' and cl_b = ‘0' then q_nxt := '1'; qb_nxt := '1'; elsif pr_b = ‘0' then q_nxt := '1'; qb_nxt := '0'; elsif cl_b = ‘0' then q_nxt := '0'; qb_nxt := '1';

(29)

DFFのビヘイビア記述 (2/2)

elsif rising_edge( clock ) then q_nxt := d_in; qb_nxt := not d_in; end if; if q_nxt = '1' then q_out <= q_nxt after Tpd_lh; else q_out <= q_nxt after Tpd_hl; end if; end process P1;

(30)

エッジトリガーの原理

Step 1

Step 2

(31)

Dラッチを用いたDFFの構成

†

マスタースレーブ・データ・ロックアウト型

D

Q

G

Q

D

Q

G

Q

d_in

clock

q_out

clk_b

m_out

(32)

Dラッチを用いたDFFの実現(1)

library ieee; use ieee.std_logic_1164.all; use work.ALL; entity DFF_MS is generic(

Tpd_lh: time := 2 ns; -- Rising Delay ( '0' to '1' ) Tpd_hl: time := 4 ns ); -- Falling Delay ( '1' to '0' ) port (

clock: in std_logic; d_in: in std_logic; q_out: out std_logic ); end entity DFF_MS;

(33)

Dラッチを用いたDFFの実現(2)

architecture STRUCTURE of DFF_MS is component D_LATCH is port ( sel: in std_logic; d_in: in std_logic; q_out: out std_logic ); end component D_LATCH; signal clk_b: std_logic; signal m_out: std_logic;

for M_LAT: D_LATCH use entity work.D_LATCH( DATA_FLOW ); for S_LAT: D_LATCH use entity work.D_LATCH( DATA_FLOW );

(34)

Dラッチを用いたDFFの実現(3)

begin

clk_b <= not clock;

M_LAT: D_LATCH port map( en => clk_b,

d_in => d_in,

q_out => m_out );

S_LAT: D_LATCH port map( en => clock,

d_in => m_out, q_out => q_out );

(35)

DFFの動作

d_in

d_out

clock

clk_b

m_out

(36)

講義内容

†

フリップ・フロップの基本原理

†

RSフリップ・フロップ

†

Dラッチ

†

Dフリップ・フロップ

†

JKフリップ・フロップ

†

Tフリップ・フロップ

†

まとめ

(37)

JKフリップ・フロップ(JKFF)

†

MIL記号

„

7473, 7476 など

„

4027, 4095, 4096

J Q CK

JKFF

Q CLR PR K

(38)

JKFFの動作表

J K clock ‘0’ ‘-’ ‘-’ ‘0’ ‘1’ ‘-’ ‘1’ ‘0’ ‘-’ ‘-’ ‘1’ ‘0’ ‘-’ ‘0’ ‘1’ ‘-’ ‘-’ ‘0’ ‘0’ ‘-’ ‘1’ ‘1’ ‘1’ ‘0’ ‘1’ ‘-’ ‘0’ ‘0’ ‘1 ‘1’ ‘-’ preset clear Q Q ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ Q ‘1’ ‘1’ ‘0’ Q ‘1’ ‘0’ Q ‘1’ ‘1’ ‘1’ Q ‘1’ Q Q

(39)

JKFFのエンティティ記述

library ieee; use ieee.std_logic_1164.all; entity JKFF is port ( clock: in std_logic; pr_b: in std_logic; clr_b: in std_logic; J_in: in std_logic; K_in: in std_logic; Q_out: out std_logic; Qb_out: out std_logic ); end entity JKFF;

(40)

JKFFのビヘイビア記述(1/4)

architecture BEAVIOR of JKFF is

begin

P1: process( clock, pr_b, clr_b )

variable q_nxt: std_logic;

variable qb_nxt: std_logic;

variable q_tmp: std_logic;

begin

(41)

JKFFのビヘイビア記述(2/4)

if pr_b = ‘0' and clr_b = ‘0' then -- Preset & Clear q_nxt := '1';

qb_nxt := '1';

elsif pr_b = ‘0' and clr_b = ‘1’then -- Preset q_nxt := ‘1';

qb_nxt := ‘0';

elsif pr_b = ‘1’ and clr_b = ‘0' then -- Clear q_nxt := ‘0';

qb_nxt := ‘1';

(42)

JKFFのビヘイビア記述(3/4)

if falling_edge( clock ) then -- Load New Data or Toggle if j_in = '0' and k_in = '0' then -- No Change

NULL;

elsif j_in = '0' and k_in = '1' then-- Set ‘0’ q_nxt := '0';

qb_nxt := '1';

elsif j_in = '1' and k_in = '0' then -- Set ‘1’ q_nxt := '1';

qb_nxt := '0';

elsif j_in = '1' and k_in = '1' then -- Toggle q_tmp := q_nxt;

q_nxt := qb_nxt; qb_nxt := q_tmp; end if;

(43)

JKFFのビヘイビア記述(4/4)

else -- Unexpected Control Signals q_nxt := 'X'; qb_nxt := 'X'; end if; end if; q_out <= q_nxt; qb_out <= qb_nxt; end process P1;

(44)

DFFを用いたJKFFの実現

D Q

DFF

CK Q J K CK

(45)

講義内容

†

フリップ・フロップの基本原理

†

RSフリップ・フロップ

†

Dラッチ

†

Dフリップ・フロップ

†

JKフリップ・フロップ

†

Tフリップ・フロップ

†

まとめ

(46)

Tフリップ・フロップ(TFF)

†

入力パルスが入るたびに出力が反転

†

エッジ・トリガー・タイプ

CLR

T

Q’

‘0’

‘0’

‘1’

Q

CLR

T

Q

TFF

(47)

TFFの動作

clr_b

T

Q

10 20 0 30 40 50 60 70 80 90 100 ns

(48)

TFFのエンティティ記述

library ieee;

use ieee.std_logic_1164.all;

entity TFF is

port (

clr_b:

in

std_logic;

T_in:

in

std_logic;

Q_out:

out

std_logic );

end entity TFF;

(49)

TFFのビヘイビア記述 (1/2)

architecture BEHAVIOR of TFF is begin P1: process( clr_b, T_in ) variable d_nxt: std_logic; begin if clr_b = ‘0' then -- Clear d_nxt := '0';

elsif clr_b = ‘1’ then -- Normal Action if rising_edge( T_in ) then -- Toggle

d_nxt := not d_nxt; end if;

(50)

TFFのビヘイビア記述 (1/2)

else -- Unexpected Control Signal d_nxt := ‘X’;

end if;

Q_out <= d_nxt; end process P1;

(51)

DFFによるTFFの実現

D Q

DFF

CK Q CLR

T_in

Q_out

clear

(52)

DFFを用いたTFFの動作

clr_b

D_in

Q_out

T_in

Qb_out

(53)

JKFFによるTFFの実現方法 (1)

J Q CK

JKFF

Q CLR K

Q_out

T_in

clear

‘1’

‘1’

(54)

JKFFによるTFFの実現方法 (2)

J Q CK

JKFF

Q CLR K

Q_out

T_in

clear

(55)

講義内容

†

フリップ・フロップの基本原理

†

RSフリップ・フロップ

†

Dラッチ

†

Dフリップ・フロップ

†

JKフリップ・フロップ

†

Tフリップ・フロップ

†

まとめ

(56)

まとめ (1/2)

†

フリップ・フロップの基本原理は,帰還を持つイン

バータ回路.

†

RSフリップ・フロップは,NANDゲートまたは

NORゲートによって実現できる.

†

RSフリップ・フロップは禁止入力を持つ.

†

Dラッチは,レベルセンシティブな記憶素子.

†

Dフリップ・フロップは,クロック信号のエッジでト

リガーされる記憶素子.

(57)

まとめ (2/2)

†

Dフリップ・フロップは,Dラッチを用いて実現でき

る.

†

JKフリップ・フロップは,Dフリップ・フロップと論

理ゲートを用いて実現できる.

†

Tフリップ・フロップは,入力パルスが入るたびに

出力が反転する.

†

Tフリップ・フロップは,DフリップまたはJKフリッ

プ・フロップを用いて実現できる.

参照

関連したドキュメント

As an application of the boundedness of maximal functions, we establish Sobolev’s embedding theorem for variable exponent Riesz potentials on metric space; in the case a 1 = 0 ,

The method proposed by Hackbusch and Sauter [7] also employs polar coordinates, but performs the inner integration analytically, while the outer integral is evaluated using

Using notions from Arakelov theory of arithmetic curves, van der Geer and Schoof were led to introduce an analogous zeta function for number fields [GS].. In [LR] Lagarias and

Instead an elementary random occurrence will be denoted by the variable (though unpredictable) element x of the (now Cartesian) sample space, and a general random variable will

Key words: anisotropic variable exponent Sobolev spaces, weak solution, critical point, Mountain Pass Theorem, variational methods..

These articles are concerned with the asymptotic behavior (and, more general, the behavior) and the stability for delay differential equations, neu- tral delay differential

In our analysis, it was observed that radiation does affect the transient velocity and temperature field of free-convection flow of an electrically conducting fluid near a

In this paper, based on the concept of rough variable proposed by Liu 14, we discuss a simplest game, namely, the game in which the number of players is two and rough payoffs which