0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

アナログデジタルNAND回路

Posted at

アナログデジタルNAND回路

function [analog_out, digital_bit1, digital_bit2] = nand_analog_digital(V1, V2, VDD)
% 入力:
% V1: 入力電圧1
% V2: 入力電圧2
% VDD: 電源電圧
%
% 出力:
% analog_out: アナログ出力
% digital_bit1: デジタル出力1 (中間NANDの状態)
% digital_bit2: デジタル出力2 (反転状態)

% 閾値電圧
Vth = VDD / 2;

% 論理NAND動作(デジタルビット)
if (V1 > Vth) && (V2 > Vth)
    digital_bit1 = 0; % 両方が高い場合 -> 0
else
    digital_bit1 = 1; % それ以外 -> 1
end

% デジタル出力2: 反転 (NOT)
digital_bit2 = ~digital_bit1;

% アナログ出力: NAND結果に応じて電源電圧または0V
if digital_bit1 == 1
    analog_out = VDD; % 高い場合 -> VDD
else
    analog_out = 0;   % 低い場合 -> 0V
end
end

image.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?