matlab code for half adder

33 ビュー (過去 30 日間)
SHOBA MOHAN
SHOBA MOHAN 2017 年 4 月 2 日
編集済み: rohan ch 2020 年 2 月 27 日
function [(d,c)] = HA((a,b)) %UNTITLED Summary of this function goes here % Detailed explanation goes here a = logical([0]); b = logical([1]); c= a&b; d= xor (a,b); while running the code i got only one output but i need value for c and d. while using this function into full adder it gives "Subscripted assignment dimension mismatch". suggest me to overcome this issue.
  1 件のコメント
Rik
Rik 2017 年 4 月 2 日
Have a read here and here. It will greatly improve your chances of getting an answer.

サインインしてコメントする。

回答 (1 件)

rohan ch
rohan ch 2020 年 2 月 27 日
編集済み: rohan ch 2020 年 2 月 27 日
clc;
clear all;
close all;
A=input('enter the input');
B=input('enter the input');
sum=xor(A,B);
carry=and(A,B);
disp(sum);
disp(carry);

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

タグ

タグが未入力です。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by