matlab code for half adder
39 ビュー (過去 30 日間)
古いコメントを表示
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.
回答 (2 件)
ragxyz
2024 年 7 月 29 日
A=input('enter the input');
B=input('enter the input');
sum=xor(A,B);
carry=and(A,B);
disp(sum);
disp(carry);
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!