matlab code for half adder

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 comentario

Rik
Rik el 2 de Abr. de 2017
Have a read here and here. It will greatly improve your chances of getting an answer.

Iniciar sesión para comentar.

Respuestas (2)

rohan ch
rohan ch el 27 de Feb. de 2020
Editada: rohan ch el 27 de Feb. de 2020

0 votos

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);
ragxyz
ragxyz el 29 de Jul. de 2024

0 votos

A=input('enter the input');
B=input('enter the input');
sum=xor(A,B);
carry=and(A,B);
disp(sum);
disp(carry);

Categorías

Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.

Etiquetas

Aún no se han introducido etiquetas.

Preguntada:

el 2 de Abr. de 2017

Respondida:

el 29 de Jul. de 2024

Community Treasure Hunt

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

Start Hunting!

Translated by