-
Notifications
You must be signed in to change notification settings - Fork 0
/
IMT2019030_Block.cpp
53 lines (48 loc) · 939 Bytes
/
IMT2019030_Block.cpp
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
#include "IMT2019030_Block.h"
//Constructors
Block::Block(){}
Block::Block(int tag,int data){
Bitset v(1);
Bitset t(tag);
Bitset d(data);
this->ValidBit=v;
this->Tag=t;
this->Data=d;
}
Block::Block(Bitset tag,Bitset data){
Bitset v(1);
this->ValidBit=v;
this->Tag=tag;
this->Data=data;
}
Block::~Block(){}
Block::Block(const Block&oldObj){
this->ValidBit=oldObj.ValidBit;
this->Tag=oldObj.Tag;
this->Data=oldObj.Data;
}
//Getters and Setters
Bitset Block::BValidBit(){
return this->ValidBit;
}
Bitset Block::BTag(){
return this->Tag;
}
Bitset Block::BData(){
return this->Data;
}
void Block::setValidBit(Bitset validBit){
this->ValidBit=validBit;
}
void Block::setTag(Bitset tag){
this->Tag=tag;
}
void Block::setData(Bitset data){
this->Data=data;
}
int Block::TagSize(){
return this->Tag.size();
}
int Block::DataSize(){
return this->Data.size();
}