From 0c8f00af77da54c7d1f0781f8d3d90fcd1788aaa Mon Sep 17 00:00:00 2001 From: Medium Fries Date: Mon, 1 Oct 2018 15:54:53 -0700 Subject: [PATCH] cst337/lec9/10 need fixing + transcribing --- .gitignore | 1 + cst337/lec/lec10.md | 4 ++ cst337/lec/lec9.md | 115 ++++++++++++++++++++++++++++++++++++++++++++ cst337/readme.md | 8 ++- 4 files changed, 126 insertions(+), 2 deletions(-) create mode 100644 cst337/lec/lec10.md create mode 100644 cst337/lec/lec9.md diff --git a/.gitignore b/.gitignore index 1b883ab..292bf4e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ sem/ +*swp diff --git a/cst337/lec/lec10.md b/cst337/lec/lec10.md new file mode 100644 index 0000000..7fd6d5e --- /dev/null +++ b/cst337/lec/lec10.md @@ -0,0 +1,4 @@ +# lec10 + +> whole section still needs to be transcribed over fom paper + diff --git a/cst337/lec/lec9.md b/cst337/lec/lec9.md new file mode 100644 index 0000000..96c38c8 --- /dev/null +++ b/cst337/lec/lec9.md @@ -0,0 +1,115 @@ +# lec9 + +This lecture has a corresponding activity found in `lab/` it is called `combinational-logic.md`. +It is more useful to practice combinational logic as opposed to read about it so the sub section here will be minimal in information. +It's recommended that you try as many of the problems in the activity until you understand the concept, _don't bother doing them all_. + +## Combinational Logic + +### OR + +`a+b` is equivalent to saying `a` or `b`. + +### AND + +`ab` is equivalent to saying `a` and `b`. + +Note that this syntax is simlar to multiplication so `a*b` is equivalent to the above. + +### NOT + +`!a` is equivalent to saying not `a`. +We can also denote it with a bar over the expression we want to _not_. + +![Figure-Not](../img/not.png) + +### Big AND + +Behavior is the same as an `and` but instead of two inputs we can have many more inputs. +It will only ever return a 1 if all inputs are 1. + +### Big OR + +Again we are mimicing the behvior of the normal or gate but this time we can have multiple inputs as opposed to just two. +If only one of the many inputs is 1 then we return a 1 for the output of the Big OR. + +## Decoders + +Here we'll learn by doing + +``` +Selector = 2 Bits +Output = 4 Bits +``` +As a challenge you can try using the combinational logic gates from above to try and tackle this yourself + +|s1 |s2 |o3 |o2 |o1 |o0 | +|---|---|---|---|---|---| +| 0 | 0 | 0 | 0 | 0 | 1 | +| 0 | 1 | 0 | 0 | 1 | 0 | +| 1 | 0 | 0 | 1 | 0 | 0 | +| 1 | 1 | 1 | 0 | 0 | 0 | + + +## Multiplexor + +Typically we'll refer to multiplexors by their size. + +> what does it do? + +It takes a signal as `2^n` inputs and out puts out `n` signals as output. + +Example: We have a selector(s0), two inputs[in0 & in1], and one output `out`. +The selector will select an input and we will generate some output in `out`. + +|s0 | i0 | i1 | out| +|---|---|---|---| +|0 | 0 | 0 | 0| +|0 | 0 | 1 | 1| +|0 | 1 | 0 | 0| +|0 | 1 | 1 | 1| +|1 | 0 | 0 | 0| +|1 | 0 | 1 | 0| +|1 | 1 | 0 | 1| +|1 | 1 | 1 | 1| + + +This ultimately lets us pick data out of memory given some address. + +## Half Adder + +For now we'll take two inputs and get 1 output, with a carry-output. + +Let's add 2 bits + +ab |out +00 |0 +01 |1 +10 |1 +11 |0 + +What about the carry bit however? What would _it_ look like given the preivous operations? + +ab |carryout +00 |0 +01 |0 +10 |0 +11 |1 + +Before what this implies note that the result of the carryout resembles + +## Full Adder + +Two inputs, One output, One carry-out, One carry-in + +Here we'll add up `a & b`(inputs) and `c` carry-in + +cab |output +000 |0 +001 |1 +010 |1 +011 |0 +100 |1 +101 |0 +110 |0 +111 |1 diff --git a/cst337/readme.md b/cst337/readme.md index 73e9e58..bd1940b 100644 --- a/cst337/readme.md +++ b/cst337/readme.md @@ -1,5 +1,9 @@ -# Subject - Assembly with MIPS \ -Assembly and other such things here +# Subject - Computer Architecture & Assembly with MIPS \ + +Material on the hardware side of this course covers everything from transistors up to logic gates. +Assembly is among the second half of this course(_ymmv_) if the course is flip-flopped for you. ## In progress Citations + Ascii section in [lec2](lec2.md) is off by a few bytes +lec5 is empty for some reason