30 lines
452 B
C#
30 lines
452 B
C#
using System;
|
|
using hwo.bitworks.identity;
|
|
|
|
namespace hwo.bitworks
|
|
{
|
|
public class NAND : LogicBase
|
|
{
|
|
|
|
public NAND(LogicBase[] sources)
|
|
:base(sources){
|
|
}
|
|
|
|
public override bool value()
|
|
{
|
|
foreach (LogicBase source in this.sources){
|
|
if (!source.value()){
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public override BitIdentity identity()
|
|
{
|
|
return new BitIdentity(BitOperation.NAND,identities(this.sources));
|
|
}
|
|
|
|
}
|
|
}
|