Object subclass: #TD4Connector instanceVariableNames: 'input outputs' classVariableNames: '' poolDictionaries: '' category: 'TD4-Basic'! !TD4Connector methodsFor: 'accessing' stamp: 'ei 9/6/2006 12:28'! addOutputTarget: anObject selector: aSymbol | output | output := TD4Output target: anObject selector: aSymbol. outputs add: output! ! !TD4Connector methodsFor: 'accessing' stamp: 'ei 9/6/2006 18:30'! input: anObject input := anObject. outputs do: [:each | each input: anObject]! ! !TD4Connector methodsFor: 'initialization' stamp: 'ei 9/6/2006 13:05'! initialize outputs := Set new. ! ! "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! TD4Connector class instanceVariableNames: ''! !TD4Connector class methodsFor: 'as yet unclassified' stamp: 'ei 9/6/2006 12:30'! new ^ self basicNew initialize! ! Object subclass: #TD4LogicIC instanceVariableNames: 'output' classVariableNames: '' poolDictionaries: '' category: 'TD4-Basic'! !TD4LogicIC methodsFor: 'accessing' stamp: 'ei 9/6/2006 12:43'! output: aConnector output := aConnector! ! TD4LogicIC subclass: #TD4Buffer instanceVariableNames: 'outBuffer' classVariableNames: '' poolDictionaries: '' category: 'TD4-Basic'! !TD4Buffer methodsFor: 'accessing' stamp: 'ei 9/8/2006 23:36'! outBuffer: anObject outBuffer := anObject. output ifNotNil: [output input: outBuffer]! ! !TD4Buffer methodsFor: 'accessing' stamp: 'ei 9/8/2006 23:37'! reset self outBuffer: 0! ! !TD4Buffer methodsFor: 'accessing' stamp: 'ei 9/8/2006 23:36'! value ^ outBuffer! ! TD4LogicIC subclass: #TD4FlipFlop instanceVariableNames: 'input load store outBuffer defaultLoad' classVariableNames: '' poolDictionaries: '' category: 'TD4-Basic'! !TD4FlipFlop methodsFor: 'accessing' stamp: 'ei 9/7/2006 16:09'! clock1 (load = 0 and: [input notNil]) ifTrue: [store := input]. input := nil! ! !TD4FlipFlop methodsFor: 'accessing' stamp: 'ei 9/7/2006 16:17'! clock2 outBuffer := store. output ifNotNil: [output input: store]! ! !TD4FlipFlop methodsFor: 'accessing' stamp: 'ei 9/6/2006 23:06'! defaultLoad: aNumber defaultLoad := aNumber. load := aNumber! ! !TD4FlipFlop methodsFor: 'accessing' stamp: 'ei 9/7/2006 16:06'! input: anObject input := anObject! ! !TD4FlipFlop methodsFor: 'accessing' stamp: 'ei 9/7/2006 16:05'! load: aNumber load := aNumber! ! !TD4FlipFlop methodsFor: 'accessing' stamp: 'ei 9/7/2006 16:18'! reset input := nil. store := 0. outBuffer := 0. load := defaultLoad. self clock2! ! !TD4FlipFlop methodsFor: 'accessing' stamp: 'ei 9/7/2006 16:08'! value ^ outBuffer! ! !TD4FlipFlop methodsFor: 'initialization' stamp: 'ei 9/7/2006 16:21'! initialize defaultLoad := 1. input := nil. store := 0. outBuffer := 0. load := defaultLoad! ! !TD4FlipFlop methodsFor: 'printing' stamp: 'ei 9/7/2006 16:11'! printOn: aStream aStream nextPutAll: 'FF('; nextPutAll: input asString; nextPutAll: '-'; nextPutAll: store asString; nextPutAll: '-'; nextPutAll: outBuffer asString; nextPutAll: ')'! ! "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! TD4FlipFlop class instanceVariableNames: ''! !TD4FlipFlop class methodsFor: 'as yet unclassified' stamp: 'ei 9/6/2006 14:36'! new ^ self basicNew initialize! ! TD4FlipFlop subclass: #TD4Counter instanceVariableNames: 'base' classVariableNames: '' poolDictionaries: '' category: 'TD4-Basic'! !TD4Counter methodsFor: 'accessing' stamp: 'ei 9/6/2006 12:59'! base: aNumber base := aNumber! ! !TD4Counter methodsFor: 'accessing' stamp: 'ei 9/7/2006 16:28'! clock1 load = 0 ifTrue: [input ifNotNil: [store := input]] ifFalse: [store := store + 1 \\ base]. input := nil! ! !TD4Counter methodsFor: 'initialization' stamp: 'ei 9/7/2006 16:25'! initialize super initialize. base := 100! ! !TD4Counter methodsFor: 'printing' stamp: 'ei 9/7/2006 16:21'! printOn: aStream aStream nextPutAll: 'Counter('; nextPutAll: input asString; nextPutAll: '-'; nextPutAll: store asString; nextPutAll: '-'; nextPutAll: outBuffer asString; nextPutAll: ')'! ! TD4LogicIC subclass: #TD4FullAdder instanceVariableNames: 'inputA inputB base outBuffer outputCarry' classVariableNames: '' poolDictionaries: '' category: 'TD4-Basic'! !TD4FullAdder methodsFor: 'accessing' stamp: 'ei 9/6/2006 12:49'! base: aNumber base := aNumber! ! !TD4FullAdder methodsFor: 'accessing' stamp: 'ei 9/8/2006 23:20'! inputA ^ inputA! ! !TD4FullAdder methodsFor: 'accessing' stamp: 'ei 9/6/2006 12:48'! inputA: anObject inputA := anObject. self doOutput! ! !TD4FullAdder methodsFor: 'accessing' stamp: 'ei 9/8/2006 23:20'! inputB ^ inputB! ! !TD4FullAdder methodsFor: 'accessing' stamp: 'ei 9/6/2006 12:48'! inputB: anObject inputB := anObject. self doOutput! ! !TD4FullAdder methodsFor: 'accessing' stamp: 'ei 9/6/2006 18:10'! outputCarry: anObject outputCarry := anObject! ! !TD4FullAdder methodsFor: 'accessing' stamp: 'ei 9/9/2006 00:12'! value ^ outBuffer \\ base! ! !TD4FullAdder methodsFor: 'private' stamp: 'ei 9/8/2006 23:20'! doOutput outBuffer := inputA + inputB. output ifNotNil: [output input: outBuffer \\ base]. outputCarry ifNotNil: [outputCarry input: outBuffer // base]! ! !TD4FullAdder methodsFor: 'initialization' stamp: 'ei 9/8/2006 23:20'! initialize inputA := 0. inputB := 0. outBuffer := 0. base := 100! ! "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! TD4FullAdder class instanceVariableNames: ''! !TD4FullAdder class methodsFor: 'as yet unclassified' stamp: 'ei 9/6/2006 20:45'! new ^ self basicNew initialize! ! Object subclass: #TD4Output instanceVariableNames: 'target selector' classVariableNames: '' poolDictionaries: '' category: 'TD4-Basic'! !TD4Output methodsFor: 'accessing' stamp: 'ei 9/6/2006 18:30'! input: anObject target perform: selector with: anObject! ! !TD4Output methodsFor: 'private' stamp: 'ei 9/6/2006 12:25'! setTarget: anObject selector: aSymbol target := anObject. selector := aSymbol. ! ! "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! TD4Output class instanceVariableNames: ''! !TD4Output class methodsFor: 'as yet unclassified' stamp: 'ei 9/6/2006 12:26'! target: anObject selector: aSymbol | obj | obj := self basicNew. obj setTarget: anObject selector: aSymbol. ^ obj! ! TD4LogicIC subclass: #TD4Selector instanceVariableNames: 'inputs selection' classVariableNames: '' poolDictionaries: '' category: 'TD4-Basic'! !TD4Selector methodsFor: 'private' stamp: 'ei 9/6/2006 21:13'! initialize: aNumber inputs := Array new: aNumber withAll: 0! ! !TD4Selector methodsFor: 'private' stamp: 'ei 9/6/2006 21:15'! input: anObject at: aSymbol inputs at: aSymbol + 1 put: anObject. output ifNil: [^ self]. aSymbol = selection ifTrue: [output input: anObject]! ! !TD4Selector methodsFor: 'private' stamp: 'ei 9/6/2006 21:15'! selection: aSymbol | input | selection := aSymbol. output ifNil: [^ self]. input := inputs at: aSymbol + 1. output input: input! ! "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! TD4Selector class instanceVariableNames: ''! !TD4Selector class methodsFor: 'as yet unclassified' stamp: 'ei 9/6/2006 21:14'! new self shouldNotImplement! ! !TD4Selector class methodsFor: 'as yet unclassified' stamp: 'ei 9/6/2006 21:14'! new: aNumber ^ self basicNew initialize: aNumber! ! TD4Selector subclass: #TD4Selector4 instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'TD4-Basic'! !TD4Selector4 methodsFor: 'accessing' stamp: 'ei 9/6/2006 21:16'! input0: anObject self input: anObject at: 0! ! !TD4Selector4 methodsFor: 'accessing' stamp: 'ei 9/6/2006 21:16'! input1: anObject self input: anObject at: 1! ! !TD4Selector4 methodsFor: 'accessing' stamp: 'ei 9/6/2006 21:16'! input2: anObject self input: anObject at: 2! ! !TD4Selector4 methodsFor: 'accessing' stamp: 'ei 9/6/2006 21:16'! input3: anObject self input: anObject at: 3! ! !TD4Selector4 methodsFor: 'initialization' stamp: 'ei 9/6/2006 21:17'! initialize super initialize: 4! ! "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! TD4Selector4 class instanceVariableNames: ''! !TD4Selector4 class methodsFor: 'as yet unclassified' stamp: 'ei 9/6/2006 21:18'! new ^ self basicNew initialize! !