ok. so the binary form is stored in the string. and the i will make a for loop that will count the number of 1's in the binary form of each entered minterms. my problems is how do I group together the minterms with the same number of 1's cause i need to compare 2 different groups later.
Reuben Cabrera
Posts
-
quine mccluskey method on C/C++ -
quine mccluskey method on C/C++and quine mccluskey method would require grouping the minterms according to the # of 1's in their binary form. how do you do that? then printing the final output as wxyz w'x' etc.
-
quine mccluskey method on C/C++#include<stdio.h>
#include<stdlib.h>
#include<conio.h>int convert(int);
main()
{
int var,x,y,number,number2;
int minterms[x],minterm[y];printf("=========QUINE MCCLUSKEY METHOD========");
printf("\nHOW MANY VARIABLES DOES THE FUNCTION HAVE:?");
scanf("%d",&var);printf("\nHOW MANY MINTERMS?:");
scanf("%d",&number);
number2=number;
for(x=0;number2!=0;number2--)
{
printf("\nENTER MINTERM:");
scanf("%d",&minterms[x]);
x++;
}//convert each minterm to there binary form//
x=0;
y=0;
while(number!=0)
{
minterm[y]=convert(minterm[x]);
x++;
y++;
}y=0;
while(number!=0)
{
printf("\n %d",minterm[y]);
number--;
y++;
}}
int convert(int a)
{
int quot,binarynumber[100],i=1,sum=0;
int multi;
quot=a;
while(quot!=0)
{
binarynumber[i++]=quot%2;
quot= quot/2;
if(i==1)
{
sum=sum + (binarynumber[i++] * 1);
}
elsesum = sum + (binarynumber\[i++\] \* multiplier); } return sum;
}
-
quine mccluskey method on C/C++im already at converting the decimal # to binary. but the problem is the output should be like as a whole. i saw other programs converting decimal to binary and they just printed the remainder in reverse. my plan is to multiply the first digit to 10^0 then the next is by powers of 10 so when I add it i will have a whole number.
-
quine mccluskey method on C/C++im not submitting someone else's code. i just need help. that's all.
-
quine mccluskey method on C/C++hey guys, can I ask for help. can you guys help me with the algorithm/code for quine mccluskey method on C/C++. i kinda having trouble with the algorithm and I need to provide the code on Oct 9 for my CS class. please do help me with my machine problem :) thank you and God bless. :D