====================================== Building registers and a register bank [TOC] ====================================== Starting with a __D flip-flop__ we will build an 8-bit register first and then a register bank for our ALU. Description of the register bank: - It contains 4 registers and each of it can store 8 bits. Each registers has a 2-bit id (`00`, `01`, `10`, `11`). For simplicity we sometimes call them just "register 0", "register 1" which obviously correlates which the interpretation of the id as an unsigned integer. - It supports read and write operations: - (_Reading_) With the 2-bit inputs `sel_out0` and `sel_out1` you can select from which register you read the content from the 8-bit outputs `out0` and `out1` respectively. - (_Writing_) With the 2-bit input `sel_in` you can select which register gets overwritten with the 8-bit input `in`. Overwriting takes affect if the `clock` input is one. We will introduce in the next section a more compact notation to address a register. - Special register: Register `reg0` is a _zero register_. It always contains a bit pattern with zeros only, i.e. writing to it simply gets ignored, reading from it gives always the zeros bit bit pattern. Video tutorial ============== In the video I will start with a copy of the final project in session 2. __This__ is a link to my project for session 2 and if you want you can fork it so that we start on the same page. ---- VIDEO ------------------------------ https://www.youtube.com/embed/kUDNEQn2TlQ ----------------------------------------- :links: D flip-flop -> https://en.wikipedia.org/wiki/Flip-flop_(electronics)#D_flip-flop This -> https://circuitverse.org/users/20564/projects/76282 :navigate: up -> doc:index next -> doc:session03/page03 back -> doc:session03/page01