-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathalu.h
More file actions
61 lines (40 loc) · 1011 Bytes
/
alu.h
File metadata and controls
61 lines (40 loc) · 1011 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef ALU_H
#define ALU_H
#include "controller.h"
#include <QObject>
#include <QVariant>
#include <QString>
class ALU : public QObject
{
Q_OBJECT
signals:
void setGuiProperty(const QString &name, const QVariant &data);
public:
ALU(Controller* cont, QObject &appMgr);
void add(sint value);
void subtract(sint value);
void multiply(sint value);
void divide(sint value);
void And(sint value);
void Or(sint value);
void Xor(sint value);
void rotL(sint value);
void rotR(sint value);
void shiL(sint value);
void shiR(sint value);
void comp(sint value);
void toggleAnimations(bool newState);
private:
Controller* controller;
bool doAnimations;
bool continueAnim;
bool idle;
void setOperator(std::string op);
void setArg(sint);
void setResult(sint);
sint countBits(sint value);
sint getOfCaFlags(sint result, long long int realResult);
public slots:
void stepAnimation();
};
#endif // ALU_H