ORER and Exclusive ORER (XORER) in Computers

 All things in all posts will help you visualize about the way that computers work generally. Note that it is not the real structure of modern computers, but the way that modern computers work is nearly the same as in my posts. I am sure that if you understand about the way that computers work in my posts, you will easy to learn about all fields of computer afterward. Thank you !!!

Firstly, we come to the ORER. The ORER will have two bytes in two registers as inputs and one byte in one register as output. This ORER is constructed from eight OR gates. Each corresponding bit in each byte of inputs will go in the same OR gate. For example, the first bit of the first register will go in the same OR gate as the first bit of the second register and similar for remaining bits. 

Then, the outputs of OR gates will become bits in one register. This register will be the place that contains output of ORER. Let’s look at the diagram below for understanding structures of ORER:

You can see that all is the same as I described. Now, what is the use of the ORER? In reality, we have many tasks that need this ORER and one of them is converting uppercase letters to lowercase letters. For example, we have an uppercase letter of “A” that has binary code in the ASCII table of “01000001”. Assume that this byte of letter is in a register of R0, then we have another byte of “00100000” in R1. 

We will use ORER for R0 and R1 above then the result will be stored into R0 again. As you can see, R0 and R1 will be inputs of ORER, so we use OR gates for every pair of corresponding bits. Now, every bit in the result R0 will be the same as R0 at first, except the third bit (because we have an “1” signal in the third bit of R1).

We will have a result in R0 is “01100001” that is binary for “a” letter in the ASCII table. So, we converted uppercase “A” letter to lowercase “a” letter. Now, we will abstract this ORER gate for easier use later. Look at the diagram below:

Secondly, we come to the Exclusive ORER (XORER). The XORER will have two bytes in two registers as inputs and one byte in one register as output. This XORER is constructed from eight XOR gates. Each corresponding bit in each byte of inputs will go in the same XOR gate. For example, the first bit of the first register will go in the same XOR gate as the first bit of the second register and similar for remaining bits. 

Then, the outputs of XOR gates will become bits in one register. This register will be the place that contains output of XORER. Let’s look at the diagram below for understanding structures of XORER:

You can see that all is the same as I described. Now, what is the use of the XORER? In reality, we have many tasks that need this XORER and one of them is comparing two bytes. For example, we have a byte of “10001000” in register R0, then we have another byte of “10001000” in R1. 

We will use XORER for R0 and R1 above then the result will be stored into R0 again. As you can see, R0 and R1 will be inputs of XORER, so we use XOR gates for every pair of corresponding bits. Now, every bit in the result R0 will be “00000000”.

We will have a result in R0 that is “00000000”. If we have the result “00000000” in R0, two bytes will be equal. If the result is not “00000000”, the two bytes are not equal. It is easy to understand if you know the way that XOR gate works. Now, we will abstract this XORER gate for easier use later. Look at the diagram below:

That is about ORER and exclusive ORER (XORER) in constructing the CPU of computers. Thanks for reading and see you later!!!

Đăng nhận xét

0 Nhận xét