2016-07-10 12:54:39 +00:00
|
|
|
//
|
|
|
|
// Storage.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 10/07/2016.
|
|
|
|
// Copyright © 2016 Thomas Harte. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef Storage_hpp
|
|
|
|
#define Storage_hpp
|
|
|
|
|
2016-07-29 11:31:02 +00:00
|
|
|
#include "../NumberTheory/Factors.hpp"
|
|
|
|
|
2016-07-10 12:54:39 +00:00
|
|
|
namespace Storage {
|
|
|
|
|
|
|
|
struct Time {
|
|
|
|
unsigned int length, clock_rate;
|
2016-07-29 11:31:02 +00:00
|
|
|
|
|
|
|
inline void simplify()
|
|
|
|
{
|
|
|
|
unsigned int common_divisor = NumberTheory::greatest_common_divisor(length, clock_rate);
|
|
|
|
length /= common_divisor;
|
|
|
|
clock_rate /= common_divisor;
|
|
|
|
}
|
2016-07-10 12:54:39 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* Storage_h */
|