76
2006/11/07 ©2006, Masaharu Imai 1 5章 基本演算回路 大阪大学 大学院基礎工学研究科 今井 正治 [email protected] http://www-ise1.ist.osaka-u.ac.jp/~imai/

5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 1

第5章 基本演算回路

大阪大学 大学院基礎工学研究科

今井 正治

[email protected]://www-ise1.ist.osaka-u.ac.jp/~imai/

Page 2: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 2

講義内容

マルチプレクサ

デマルチプレクサ

エンコーダ

デコーダ

加算器

減算器

キャリー先読み回路

ALU

Page 3: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 3

マルチプレクサとデマルチプレクサ

マルチプレクサ(Multiplexer)

複数の入力データから1つを選択して出力

デマルチプレクサ(Demultiplexer)

複数の出力ポートの1つを選択して出力

入力選択信号 出力選択信号

出力1出力2出力3

出力n

入力出力

入力1入力2入力3

入力n

Page 4: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 4

4入力マルチプレクサの機能

sel_1 sel_0 d_out

‘0’ ‘0’ d_in0

’0‘ ‘1’ d_in1

‘1’ ‘0’ d_in2

‘1’ ‘1’ d_in3

MUX_4

d_in0

d_in1

d_in2

d_in3

d_out

sel_1 sel_0

Page 5: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 5

4入力マルチプレクサのVHDL記述(1)library ieee;use ieee.std_logic_1164.all;

entity mux_4 isport(

sel_1: in std_logic;sel_0: in std_logic;d_in0: in std_logic;d_in1: in std_logic;d_in2: in std_logic;d_in3: in std_logic;d_out: out std_logic );

end entity mux_4;

Page 6: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 6

4入力マルチプレクサのVHDL記述(2)architecture behavior of mux_4 isbegin

process( sel_1, sel_0, d_in0, d_in1, d_in2, d_in3 ) variable d_nxt: std_logic;

beginif sel_1 = '0' and sel_0 = '0' then

d_nxt := d_in0;elsif sel_1 = '0' and sel_0 = '1' then

d_nxt := d_in1;elsif sel_1 = '1' and sel_0 = '0' then

d_nxt := d_in2;elsif sel_1 = '1' and sel_0 = '1' then

d_nxt := d_in3;

Page 7: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 7

4入力マルチプレクサのVHDL記述(3)else

d_nxt := 'X';end if;d_out <= d_nxt;

end process;end architecture behavior;

Page 8: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 8

4入力マルチプレクサのVHDL記述(4)architecture data_flow of mux_4 isbegin

d_out <= d_in0 when sel_1 = '0' and sel_0 = '0' elsed_in1 when sel_1 = '0' and sel_0 = '1' elsed_in2 when sel_1 = '1' and sel_0 = '0' elsed_in3 when sel_1 = '1' and sel_0 = '1' else'X';

end architecture data_flow;

Page 9: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 9

4入力マルチプレクサの回路図

d_in0

d_in1

d_in2

d_in3

sel_1

sel_0

d_out

Page 10: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 10

3ステートバッファを用いた4入力

マルチプレクサd_in0

d_in1

d_in2

d_in3

sel_1

sel_0

d_out

Page 11: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 11

講義内容

マルチプレクサ

デマルチプレクサ

エンコーダ

デコーダ

加算器

減算器

キャリー先読み回路

ALU

Page 12: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 12

2-4 デマルチプレクサ

MUX_4d_in

sel_1 sel_0

d_out0

d_out1

d_out2

d_out3

Page 13: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 13

2 to 4 デマルチプレクサの機能

sel_1 sel_0 d_out0 d_out1 d_out2 d_out3

‘0’

d_in

‘0’

‘0’

‘0’

‘0’

‘0’

‘0’

‘0’d_in

d_in‘0’

‘0’ ‘0’ d_in

’0‘ ‘1’ ‘0’

‘1’ ‘0’ ‘0’

‘1’ ‘1’ ‘0’

Page 14: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 14

デマルチプレクサのVHDL記述 (1)library ieee;use ieee.std_logic_1164.all;

entity demux_4 isport(

sel_1: in std_logic;sel_0: in std_logic;d_in: in std_logic;d_out0: out std_logic;d_out1: out std_logic;d_out2: out std_logic;d_out3: out std_logic );

end entity demux_4;

Page 15: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 15

デマルチプレクサのVHDL記述 (2)architecture behavior of demux_4 isbegin

process( sel_1, sel_0, d_in ) variable d_nxt0, d_nxt1, d_nxt2, d_nxt3: std_logic;

begind_nxt0 := '0';d_nxt1 := '0';d_nxt2 := '0';d_nxt3 := '0';if sel_1 = '0' and sel_0 = '0' then

d_nxt0 := d_in;elsif sel_1 = '0' and sel_0 = '1' then

d_nxt1 := d_in;

Page 16: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 16

デマルチプレクサのVHDL記述 (3)elsif sel_1 = '1' and sel_0 = '0' then

d_nxt2 := d_in;elsif sel_1 = '1' and sel_0 = '1' then

d_nxt3 := d_in;else

d_nxt0 := ‘X’;d_nxt1 := ‘X’;d_nxt2 := ‘X’;d_nxt3 := ‘X’;

end if;d_out0 <= d_nxt0;d_out1 <= d_nxt1;d_out2 <= d_nxt2;d_out3 <= d_nxt3;

end process;end architecture behavior;

Page 17: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 17

2 to 4デマルチプレクサの回路図

d_in

sel_1

sel_0

d_out0

d_out1

d_out2

d_out3

Page 18: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 18

講義内容

マルチプレクサ

デマルチプレクサ

エンコーダ

デコーダ

加算器

減算器

キャリー先読み回路

ALU

Page 19: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 19

エンコーダとデコーダ

エンコーダN進数を2進数に変換

例: 10進-2進 変換

デコーダ2進数をN進数に変換

例: 2進-10進 変換

10 to 2encoder

0123

9

20

21

22

23

2 to 10decoder

0123

9

20

21

22

23

Page 20: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 20

10進-2進 エンコーダの機能

2進数10進数

23 22 21 20

0 0 0 0 01 0 0 0 12 0 0 1 03 0 0 1 14 0 1 0 05 0 1 0 16 0 1 1 07 0 1 1 18 1 0 0 09 1 0 0 1

Page 21: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 21

10進-2進エンコーダのビヘイビア記述 (1)library ieee;use ieee.std_logic_1164.all;

entity enc_10 isport(

d_in0, d_in1, d_in2, d_in3, d_in4: in std_logic;d_in5, d_in6, d_in7, d_in8, d_in9: in std_logic;d_out0: out std_logic;d_out1: out std_logic;d_out2: out std_logic;d_out3: out std_logic );

end entity enc_10;

Page 22: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 22

10進-2進エンコーダのビヘイビア記述 (2)

architecture behavior of enc_10 isbegin

process( d_in0, d_in1, d_in2, d_in3, d_in4,d_in5, d_in6, d_in7, d_in8, d_in9 )

variable d_nxt0, d_nxt1, d_nxt2, d_nxt3: std_logic;begin

d_nxt0 := '0';d_nxt1 := '0';d_nxt2 := '0';d_nxt3 := '0';

Page 23: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 23

10進-2進エンコーダのビヘイビア記述 (3)

if d_in0 = '1' thend_nxt0 := '0';d_nxt1 := '0';d_nxt2 := '0';d_nxt3 := '0';

elsif d_in1 = '1' thend_nxt0 := '1';d_nxt1 := '0';d_nxt2 := '0';d_nxt3 := '0';

elsif d_in2 = '1' thend_nxt0 := '0';d_nxt1 := '1';d_nxt2 := '0';d_nxt3 := '0';

elsif d_in3 = '1' thend_nxt0 := '1';d_nxt1 := '1';d_nxt2 := '0';d_nxt3 := '0';

Page 24: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 24

10進-2進エンコーダのビヘイビア記述 (4)

elsif d_in4 = '1' thend_nxt0 := '0';d_nxt1 := '0';d_nxt2 := '1';d_nxt3 := '0';

elsif d_in5 = '1' thend_nxt0 := '1';d_nxt1 := '0';d_nxt2 := '1';d_nxt3 := '0';

elsif d_in6 = '1' thend_nxt0 := '0';d_nxt1 := '1';d_nxt2 := '1';d_nxt3 := '0';

elsif d_in7 = '1' thend_nxt0 := '1';d_nxt1 := '1';d_nxt2 := '1';d_nxt3 := '0';

Page 25: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 25

10進-2進エンコーダのビヘイビア記述 (5)

elsif d_in8 = '1' thend_nxt0 := '0';d_nxt1 := '0';d_nxt2 := '0';d_nxt3 := '1';

elsif d_in9 = '1' thend_nxt0 := '1';d_nxt1 := '0';d_nxt2 := '0';d_nxt3 := '1';

elsed_nxt0 := ‘X';d_nxt1 := ‘X';d_nxt2 := ‘X';d_nxt3 := ‘X';

end if;d_out0 <= d_nxt0;d_out1 <= d_nxt1;d_out2 <= d_nxt2;d_out3 <= d_nxt3;

end process;end architecture behavior;

Page 26: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 26

10進-2進エンコーダのデータフロー記述

architecture data_flow of enc_10 isbegin

d_out0 <= '1' when ( d_in1 = '1' or d_in3 = '1' or d_in5 = '1' or d_in7 = '1' or d_in9 = '1' ) else

'0';d_out1 <= '1' when ( d_in2 = '1' or d_in3 = '1' or d_in6 = '1'

or d_in7 = '1' ) else'0';

d_out2 <= '1' when ( d_in4 = '1' or d_in5 = '1' or d_in6 = '1' or d_in7 = '1' ) else

'0';d_out3 <= '1' when ( d_in8 = '1' or d_in9 = '1' ) else

'0';end architecture data_flow;

Page 27: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 27

74148: 8 to 3-Line Priority Encoderのインタフェース

EO GS 3 2 1 0

4

5 6 7 A3 A2 A1

A0

1516 14 13 12 11 10 9

21 3 4 5 6 7 8

VCC EO GS 3 2 1 0

4 5 6 7 EI A2 A1

A0

GND

OUTPUTS INPUTS OUTPUT

INPUTS OUTPUTS

Page 28: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 28

74148: 8 to 3-Line Priority Encoderの動作

INPUTS OUTPUTSEI 0 1 2 3 4 5 6 7 A2 A1 A0 GS EO‘1’ ‘-’ ‘-’ ‘-’ ‘-’ ‘-’ ‘-’ ‘-’ ‘-’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’‘0’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ ‘0’‘0’ ‘-’ ‘-’ ‘-’ ‘-’ ‘-’ ‘-’ ‘-’ ‘0’ ‘0’ ‘0’ ‘0’ ‘0’ ‘1’‘0’ ‘-’ ‘-’ ‘-’ ‘-’ ‘-’ ‘-’ ‘0’ ‘1’ ‘0’ ‘0’ ‘1’ ‘0’ ‘1’‘0’ ‘-’ ‘-’ ‘-’ ‘-’ ‘-’ ‘0’ ‘1’ ‘1’ ‘0’ ‘1’ ‘0’ ‘0’ ‘1’‘0’ ‘-’ ‘-’ ‘-’ ‘-’ ‘0’ ‘1’ ‘1’ ‘1’ ‘0’ ‘1’ ‘1’ ‘0’ ‘1’‘0’ ‘-’ ‘-’ ‘-’ ‘0’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ ‘0’ ‘0’ ‘0’ ‘1’‘0’ ‘-’ ‘-’ ‘0’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ ‘0’ ‘1’ ‘0’ ‘1’‘0’ ‘-’ ‘0’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ ‘0’ ‘0’ ‘1’‘0’ ‘0’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ ‘0’ ‘1’

Page 29: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 29

講義内容

マルチプレクサ

デマルチプレクサ

エンコーダ

デコーダ

加算器

減算器

キャリー先読み回路

ALU

Page 30: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 30

74138: 3 to 8-Line Decoder/Demultiplexerのインタフェース

Y0 Y1 Y2 Y3 Y4 Y5

A

B C G2A G2B G1 Y7

Y6

1516 14 13 12 11 10 9

21 3 4 5 6 7 8

VCC Y0 Y1 Y2 Y3 Y4 Y5 Y6

A B C G2A G2B G1 Y7 GND

DATA OUTPUTS

SELECT ENABLE OUTPUTS

Page 31: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 31

74138: 3 to 8-Line Decoder/Demultiplexerの動作

ENABLE SELECT

G1 G2 C B A Y0 Y1 Y2 Y3 Y4 Y5 Y6 Y7

‘-’ ‘1’ ‘-’ ‘-’ ‘-’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’

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

‘1’ ‘0’ ‘0’ ‘0’ ‘0’ ‘0’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’

‘1’ ‘0’ ‘0’ ‘0’ ‘1’ ‘1’ ‘0’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’

‘1’ ‘0’ ‘0’ ‘1’ ‘0’ ‘1’ ‘1’ ‘0’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’

‘1’ ‘0’ ‘0’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ ‘0’ ‘1’ ‘1’ ‘1’ ‘1’

‘1’ ‘0’ ‘1’ ‘0’ ‘0’ ‘1’ ‘1’ ‘1’ ‘1’ ‘0’ ‘1’ ‘1’ ‘1’

‘1’ ‘0’ ‘1’ ‘0’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ ‘0’ ‘1’ ‘1’

‘1’ ‘0’ ‘1’ ‘1’ ‘0’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ ‘0’ ‘1’

‘1’ ‘0’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ ‘1’ ‘0’

OUTPUT

G2 = G2A + G2B

Page 32: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 32

講義内容

マルチプレクサ

デマルチプレクサ

エンコーダ

デコーダ

加算器

減算器

キャリー先読み回路

ALU

Page 33: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 33

半加算器 (Half Adder)

和(Sum)

桁上り(Carry)

HAd_in1

d_in2

s_out

c_out

d_in1 d_in2 c_out s_out

‘0’ ‘0’ ‘0’ ‘0’

‘0’ ‘1’ ‘0’ ‘1’

‘1’ ‘0’ ‘0’ ‘1’

‘1’ ‘1’ ‘1’ ‘0’

s_out

c_out

d_in1

d_in2

21 d_ind_ins_out ⊕=

21 d_ind_inc_out •=

Page 34: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 34

全加算器 (Full Adder)

FAc_in

d_in1

s_out

c_outd_in2

c_in d_in1 d_in2 c_out s_out

‘0’ ‘0’ ‘0’ ‘0’ ‘0’

‘0’ ‘0’ ‘1’ ‘0’ ‘1’

‘0’ ‘1’ ‘0’ ‘0’ ‘1’

‘0’ ‘1’ ‘1’ ‘1’ ‘0’

‘1’ ‘0’ ‘1’ ‘1’ ‘0’

‘1’ ‘1’ ‘1’ ‘1’ ‘1’

‘1’ ‘0’ ‘0’ ‘0’ ‘1’

‘1’ ‘1’ ‘0’ ‘1’ ‘0’

HAHA

c_ind_in1d_in2

s_outc_out

Page 35: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 35

全加算器のエンティティ記述

library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;

entity FADD isport (

a_in: in std_logic;b_in: in std_logic;c_in: in std_logic;s_out:out std_logic;c_out:out std_logic );

end entity FADD;

Page 36: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 36

全加算器のデータフロー記述

architecture DATA_FLOW of FADD isbegin

s_out <= a_in xor b_in xor c_in;c_out <= ( a_in and b_in ) or ( a_in and c_in ) or ( b_in and c_in );

end architecture DATA_FLOW;

Page 37: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 37

並列加算器 (Ripple Carry Adder)

FA

s0

‘0’y0x0

FA

y1x1

s1

FA

y2x2

s2

FA

y3x3

s3c

LSBMSB

Page 38: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 38

講義内容

マルチプレクサ

デマルチプレクサ

エンコーダ

デコーダ

加算器

減算器

キャリー先読み回路

ALU

Page 39: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 39

減算回路の実現方法

直接減算を行う

減算専用回路

小規模なシステムの実装に適する

2の補数を作って加算を行う

大規模なシステムの実装で採用

加減算器: 加算と減算を統一的に扱う

Page 40: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 40

半減算器(d_in1 – d_in2)

差(Difference)

桁借り(Borrow)

HSd_in1

d_in2

d_out

b_out

d_in1 d_in2 d_out b_out

‘0’ ‘0’ ‘0’ ‘0’

‘0’ ‘1’ ‘1’ ‘1’

‘1’ ‘0’ ‘1’ ‘0’

‘1’ ‘1’ ‘0’ ‘0’

d_out

b_out

d_in1

d_in2

21 d_ind_ind_out ⊕=

21 d_ind_inb_out •=

Page 41: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 41

全減算器

FSb_in

d_in1

d_out

b_outd_in2

b_in d_in1 d_in2 d_out b_out

‘0’ ‘0’ ‘0’ ‘0’ ‘0’

‘0’ ‘0’ ‘1’ ‘1’ ‘1’

‘0’ ‘1’ ‘0’ ‘1’ ‘0’

‘0’ ‘1’ ‘1’ ‘0’ ‘0’

‘1’ ‘0’ ‘1’ ‘0’ ‘1’

‘1’ ‘1’ ‘1’ ‘1’ ‘1’

‘1’ ‘0’ ‘0’ ‘1’ ‘1’

‘1’ ‘1’ ‘0’ ‘0’ ‘0’

HSHS

b_ind_in1d_in2

d_outb_out

Page 42: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 42

並列減算器 (Ripple Carry Subtractor)

FS

d0

‘0’y0x0

FS

y1x1

d1

FS

y2x2

d2

FS

y3x3

d3b

LSBMSB

Page 43: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 43

全加算器を用いた加減算器の実現

CI

X3X2X1X0

Y3Y2Y1Y0

S3S2S1S0

CO被加減数 X

加減数 Y

制御信号 C

加減算結果

桁上げ/桁借り

Page 44: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 44

講義内容

マルチプレクサ

デマルチプレクサ

エンコーダ

デコーダ

加算器

減算器

キャリー先読み回路

ALU

Page 45: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 45

n桁加算回路の入出力

入力

出力

キャリー先読み回路:各桁のキャリーを短時間で計算する回路

1

021

021

−−

−−

===

CCYYYY

XXXX

in

nn

nn

L

L

1

021

−−

==

nout

nnout

CCSSSS L

Page 46: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 46

定義

Cn : n ビット目のキャリー

Gn: キャリー発生関数 (Carry Generate Function)

Pn: キャリー伝播関数 (Carry Propagation Function)

( )1

1

+=++=

nnn

nnnnnn

CPGCYXYXC

nnn YXG =

nnn YXP +=

Page 47: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 47

0桁目のキャリー

( )100

10000

1010000

−−

+=++=++=

CPGCYXYXCYCXYXC

Page 48: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 48

1桁目のキャリー

101011

10011

011

0101111

)(

++=++=

+=++=

CPPGPGCPGPG

CPGCYCXYXC

Page 49: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 49

2桁目のキャリー

1012012122

10012122

012122

01122

122

1212222

)(

)(

+++=+++=

++=++=

+=++=

CPPPGPPGPGCPGPPGPG

CPPGPGCPGPG

CPGCYCXYXC

Page 50: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 50

n桁目のキャリー

10121

0121

321

21

1

−−−

−−

−−−

−−

++++++=

CPPPPPGPPPP

GPPPGPP

GPGC

nnn

nnn

nnnn

nnn

nn

nn

L

L

L

Page 51: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 51

74182: キャリー・ルックアヘッド回路

4

4321

321

21

1

−−−−

−−−

−−

+=

++++

=

n

nnnnn

nnnn

nnn

nn

nn

CPG

CPPPPGPPP

GPPGP

GC 3CG

P1−C

Page 52: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 52

74182: キャリー・ルックアヘッド回路

00 GP 1−C11 GP22 GP33 GP

P G 2C 1C 0C

0123 PPPPP =0123123233 GPPPGPPGPGG +++=

Page 53: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 53

講義内容

マルチプレクサ

デマルチプレクサ

エンコーダ

デコーダ

加算器

減算器

キャリー先読み回路

ALU

Page 54: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 54

74181: 4 bit ALUの入出力端子

74181

A3A2A1A0

B3B2B1B0

Cn M S3 S2 S1 S0

F3F2F1F0

Cn+4

A=B

PG

A入力

B入力

キャリー入力

論理・算術選択端子 機能選択端子

F 出力

キャリー出力

A=B 出力

キャリー・ルックアヘッド出力

Page 55: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 55

74181の論理機能 (M=1)

選択端子 M=1 選択端子 M=1S3 S2 S1 S0 S2 S1 S0

0 01010101

0001111

0

1

0011001

1010101

0000111

論理機能 S3

1

00110011

論理機能

0 10 10 10 10 10 10 10 1

AF =BAF +=BAF •=

0F =BAF •=

BF =BAF ⊕=BAF •=

BAF +=BAF ⊕=

BF =BAF •=

1F =BAF +=BAF +=

AF =

Page 56: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 56

74181の算術演算機能 (M=0,Cn=0)選択端子 M=0, Cn=0 選択端子 M=0, Cn=0

S3 S2 S1 S0 S2 S1 S0

0 0

1

0

1

0

1

0

1

0

0

0

1

1

1

1

0

1

0

0

1

1

0

0

1

1

0

1

0

1

0

1

0

0

0

0

1

1

1

算術機能 S3

1

0

0

1

1

0

0

1

1

算術機能

0 1

0 1

0 1

0 1

0 1

0 1

0 1

0 1

AF =

1 MINUSF =

BAPLUSAF •=

BAF +=

BAF +=

BAPLUSB)AF •+= (

1MINUSBMINUSAF =

1 MINUSBAF •=

1 PLUS BAPLUSAF •=

1 PLUS BPLUSAF =

1 PLUS B APLUS)B(AF •+=

BAF •=

1 PLUSA PLUSAF =

1 PLUSA PLUSB)AF += (

1 PLUS A PLUS )BAF += (

AF =

Page 57: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 57

74181の算術演算機能 (M=0,Cn=1)選択端子 M=0, Cn=1 選択端子 M=0, Cn=1

S3 S2 S1 S0 S2 S1 S0

0 0101

0

1

01

000

1

1

11

0

1

0011

0

0

1

101

0

1

01

0000

1

1

1

算術機能 S3

1

0011

0

0

11

算術機能

0 10 10 10 1

0 1

0 1

0 10 1

1 PLUSA F =

ZEROF =

1 PLUS BAPLUSAF •=

1 PLUS )B(AF +=

1 PLUS B)AF += (

1 PLUS B APLUS B)(AF •+=

BMINUSAF =

BAF •=

BAPLUSAF •=

BPLUSAF =

BAPLUS)B(AF •+=

1 MINUSBAF •=

APLUSAF =

APLUSB)AF += (

APLUS)BAF += (

1 MINUSAF =

Page 58: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 58

ALUの設計方法 (1)

1. 算術演算回路を設計

2. 論理演算回路を設計

3. 上記の回路を結合 算術演算回路

論理演算回路

セレクタ

Ai

Bis0s1s2

Fi

Ci

Ci+1

Page 59: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 59

論理演算器の設計

MUX

AiBi

s01s

01

00

10

11

Fi

Page 60: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 60

ALUの設計方法 (2)

1. 算術演算部(加減算器)を設計する

2. ステップ1.で設計された算術演算回路から直接

得られる論理演算機能を調べる

3. 算術演算回路を修正して必要な論理演算を実装する

Page 61: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 61

FAS

基本となる加減算器

A1

B1

s0 s1

F1

C1 = Cin

C2

A2B2

F2FAS

A3B3

F2FAS

A4B4

F2FAS

s1 s0 Cin Y Output

0 0 0 0 F = A

0 0 1 0 F = A PLUS 1

0 1 0 B F = A PLUS B

0 1 1 B F = A PLUS B PLUS 1

1 0 0 B F = A MINUS B MINUS 1

1 0 1 B F = A MINUS B

1 1 0 1 F = A MINUS 1

1 1 1 1 F = A

C3

C4

C5 = Cout

Page 62: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 62

加減算器の内部構造

加算:s0 = 1s1 = 0減算:s0 = 0s1 = 1

FAA1

B1

s0

s1

F1

Cin

X1

Y1

C1

C2

C3

FAA2

B2

F2

X2

Y2

10 sBsBY iii +=

Page 63: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 63

算術演算回路の解析

算術演算回路の出力:

算術演算回路を用いてビットごとの論理演算を行うためには,キャリーの伝播を禁止する必要がある

とすると,

算術演算回路で実現できる論理演算:XOR,XNOR,NOT実現すべき他の論理演算: AND,OR

iiii CYXF ⊕⊕=

0=iC iii YXF ⊕=

Page 64: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 64

全加算器で実現できる論理演算

s2 s1 s0 Xi Yi Ci Fi 論理演算

1 0 0 Ai 0 0

1 0 1 Ai Bi 0 XOR

1 1 0 Ai Bi 0 XNOR

1 1 1 Ai 1 0 NOT

iii BAF ⊕=

iii BAF ⊕=

ii AF =

ii AF = OR

AND

XOR

NOT

Page 65: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 65

論理演算実現の方針

算術演算と論理演算の選択s2 = 0 のとき算術演算

s2 = 1 のとき論理演算

論理演算の種類の選択s1s0=00 のとき OR を実行

s1s0=10 のとき AND を実行

Page 66: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 66

OR演算の実現

s2s1s0 = 100 のとき,

としたい.すなわち,

iii BAX +=

iii BsssAX )( 012+=

s01s2s

Bi

Ai

Xi

Page 67: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 67

AND演算の実現

s2s1s0 = 110 のとき, としたい

とすると

ここで, とすると

となり,AND演算が実現できることがわかる

iii KAX +=

iii BAF =

iiiiiii

iiiiii

BKABKBABKAYXF

++=

⊕+=⊕= )(

ii BK =

iiiiiiiiii BABBABBBAF =++=

Page 68: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 68

論理演算の実現方法

ii

iii

iiii

CsZBsBsY

BsssBsssAX

2

10

012012

=

+=

++=

Page 69: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 69

ALUの論理図

FA

inC

2s1s0s

1A1B

1C

1Z1X

1Y

1F

2C

Page 70: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 70

実現された算術論理演算器s2 s1 s0 Cin Output Function0 0 0 0 F = A 転送

0 0 0 1 F = A + 1 インクリメント

0 0 1 0 F = A + B 加算

0 0 1 1 F = A + B + 1 加算(桁上げ付き)

0 1 0 0 F = A - B - 1 減算(桁借り付き)

0 1 0 1 F = A - B 減算

0 1 1 0 F = A - 1 ディクリメント

0 1 1 1 F = A 転送

1 0 0 - F = A or B 論理和

1 0 1 - F = A xor B 排他的論理和

1 1 0 - F = A and B 論理積

1 1 1 - F = not A 否定

Page 71: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 71

ALUのエンティティ記述

entity ALU isgeneric (

N_BIT: natural := 4 );port (

sel_in: in std_logic_vector( 2 downto 0);a_in: in std_logic_vector( N_BIT-1 downto 0 );b_in: in std_logic_vector( N_BIT-1 downto 0 );c_in: in std_logic;s_out: out std_logic_vector( N_BIT-1 downto 0 );c_out: out std_logic );

end entity ALU;

Page 72: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 72

ALUの構造記述 (1)architecture STRUCTURE of ALU is

component FADD isport (

a_in: in std_logic;b_in: in std_logic;c_in: in std_logic;s_out: out std_logic;c_out: out std_logic );

end component FADD;

Page 73: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 73

ALUの構造記述 (2)signal ctrl_1: std_logic;signal ctrl_0: std_logic;signal ctrl_p1: std_logic_vector( N_BIT-1 downto 0 );signal ctrl_p0: std_logic_vector( N_BIT-1 downto 0 );signal sel_p2: std_logic_vector( N_BIT-1 downto 0 );signal sel_p1: std_logic_vector( N_BIT-1 downto 0 );signal sel_p0: std_logic_vector( N_BIT-1 downto 0 );

signal a_tmp: std_logic_vector( N_BIT-1 downto 0 );signal b_tmp: std_logic_vector( N_BIT-1 downto 0 );signal ci_tmp: std_logic_vector( N_BIT-1 downto 0 );signal co_tmp: std_logic_vector( N_BIT-1 downto 0 );

Page 74: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 74

ALUの構造記述 (3)begin

ctrl_1 <= sel_in(2) and ( not sel_in(1) ) and ( not sel_in(0) );ctrl_0 <= sel_in(2) and sel_in(1) and ( not sel_in(0) );ctrl_p1 <= ( OTHERS => ctrl_1 );ctrl_p0 <= ( OTHERS => ctrl_0 );sel_p2 <= ( OTHERS => sel_in(2) );sel_p1 <= ( OTHERS => sel_in(1) );sel_p0 <= ( OTHERS => sel_in(0) );

a_tmp <= a_in or ( ctrl_p1 and b_in ) or ( ctrl_p0 and ( not b_in ) );b_tmp <= ( sel_p0 and b_in ) or ( sel_p1 and ( not b_in ) );ci_tmp <= ( not sel_p2 ) and ( co_tmp( N_BIT-2 downto 0) & c_in );

c_out <= ( not sel_in(2) ) and co_tmp( N_BIT-1 );

Page 75: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 75

ALUの構造記述 (4)GEN_A: for i in 0 to N_BIT-1 generate

DUT_S: FADD port map(a_in => a_tmp( i ),b_in => b_tmp( i ),c_in => ci_tmp( i ),s_out => s_out( i ),c_out => co_tmp( i ) );

end generate;

end architecture STRUCTURE;

Page 76: 5章基本演算回路 - 集積システム設計学講座 (橋本 …imai/class/DIGITAL/PDF...2006/11/07 ©2006, Masaharu Imai 3 マルチプレクサとデマルチプレクサ

2006/11/07 ©2006, Masaharu Imai 76

シミュレーション結果