講義内容
フリップ・フロップの基本原理
RSフリップ・フロップ
Dラッチ
Dフリップ・フロップ
JKフリップ・フロップ
Tフリップ・フロップ
まとめ
フリップ・フロップの基本原理(1/2)
帰還を持つインバータ回路(1個の場合)
スイッチング遅延(2 ns)を仮定
発振する
H
L
2
4
6
8
10 12 14 16
フリップ・フロップの基本原理(2/2)
帰還を持つインバータ回路(2個の場合)
2つの安定状態を持つ
インバータの個数と安定/発振の関係
奇数個の場合: 発振
偶数個の場合: 2つの安定状態を持つ
H
L
H
L
H
L
講義内容
フリップ・フロップの基本原理
RSフリップ・フロップ
Dラッチ
Dフリップ・フロップ
JKフリップ・フロップ
Tフリップ・フロップ
まとめ
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’
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
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
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;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';
RSFFのビヘイビア記述(2/2)
else q_out <= 'X'; qb_out <= 'X'; end if; end process;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
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
RSFFの動作
Q
NANDS
Q
NORQ
NORQ
NANDR
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’
RSFFへの「禁止入力」について
(S, R) = (‘1’, ‘1’) は「禁止入力」
(S, R) = (‘1’, ‘1’) が入力されると,出力は
(Q, Q) = (‘1’, ‘1’) または (‘0’, ‘0’) となる
禁止入力自体には大きな問題はない
むしろ,禁止入力の直後に(S, R) = (‘0’, ‘0’) が
入力されると回路が発振することが問題
講義内容
フリップ・フロップの基本原理
RSフリップ・フロップ
Dラッチ
Dフリップ・フロップ
JKフリップ・フロップ
Tフリップ・フロップ
まとめ
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
別名: トランスペアレント・ラッチDラッチの等価回路
G
Q
D
Dラッチの動作
①Gの値が‘1’の間,Dの値をそのまま出力する
(③Dの値は筒抜けになる)
②Gの値が‘1’から‘0’に変化すると,その時のDの値が保持される
D
Q
G
①
①
①
②
②
③
②
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 );
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;
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;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;
講義内容
フリップ・フロップの基本原理
RSフリップ・フロップ
Dラッチ
Dフリップ・フロップ
JKフリップ・フロップ
Tフリップ・フロップ
まとめ
Dフリップ・フロップ(DFF)
MIL記号
7474, 74175 など
4013
CKの端子の△印は
エッジトリガー型である
事を表す
PR,CLRの○印は,
Low Activeである事を
表す
D Q CKDFF
Q CLR PRDFFの動作表
入力 出力
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’
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;
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';
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;
エッジトリガーの原理
Step 1
Step 2
Dラッチを用いたDFFの構成
マスタースレーブ・データ・ロックアウト型
D
Q
G
Q
D
Q
G
Q
d_in
clock
q_out
clk_b
m_out
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;
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 );
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 );
DFFの動作
d_in
d_out
clock
clk_b
m_out
講義内容
フリップ・フロップの基本原理
RSフリップ・フロップ
Dラッチ
Dフリップ・フロップ
JKフリップ・フロップ
Tフリップ・フロップ
まとめ
JKフリップ・フロップ(JKFF)
MIL記号
7473, 7476 など
4027, 4095, 4096
J Q CKJKFF
Q CLR PR KJKFFの動作表
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 QJKFFのエンティティ記述
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;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
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';
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;
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;
DFFを用いたJKFFの実現
D QDFF
CK Q J K CK講義内容
フリップ・フロップの基本原理
RSフリップ・フロップ
Dラッチ
Dフリップ・フロップ
JKフリップ・フロップ
Tフリップ・フロップ
まとめ
Tフリップ・フロップ(TFF)
入力パルスが入るたびに出力が反転
エッジ・トリガー・タイプ
CLR
T
Q’
‘0’
ー
‘0’
‘1’
Q
CLR
T
Q
TFF
TFFの動作
clr_b
T
Q
10 20 0 30 40 50 60 70 80 90 100 nsTFFのエンティティ記述
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;
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;
TFFのビヘイビア記述 (1/2)
else -- Unexpected Control Signal d_nxt := ‘X’;
end if;
Q_out <= d_nxt; end process P1;