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
Reuben Cabrera wrote:
i kinda having trouble with the algorithm...
And that trouble would be?
Reuben Cabrera wrote:
please do help me with my machine problem :)
Help is a two way street. What have you done thus far?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
-
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
-
Reuben Cabrera wrote:
I need to provide the code on Oct 9 for my CS class.
And you think submitting someone else's code and claiming it as your own is a good idea?
Dear, you are sooooooooooooo old school...
THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?! -- C++ FQA Lite
-
Dear, you are sooooooooooooo old school...
THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?! -- C++ FQA Lite
-
Reuben Cabrera wrote:
I need to provide the code on Oct 9 for my CS class.
And you think submitting someone else's code and claiming it as your own is a good idea?
im not submitting someone else's code. i just need help. that's all.
-
Reuben Cabrera wrote:
i kinda having trouble with the algorithm...
And that trouble would be?
Reuben Cabrera wrote:
please do help me with my machine problem :)
Help is a two way street. What have you done thus far?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
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.
-
Dear, you are sooooooooooooo old school...
THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?! -- C++ FQA Lite
#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;
}
-
Reuben Cabrera wrote:
i kinda having trouble with the algorithm...
And that trouble would be?
Reuben Cabrera wrote:
please do help me with my machine problem :)
Help is a two way street. What have you done thus far?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
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.
-
im not submitting someone else's code. i just need help. that's all.
-
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.