go to previous page   go to home page   go to next page

Answer:

0000 1111 1010 0101       0FA5
0011 0110 1000 1111       368F

0011 1001 0010 1010       392A

Example Program

Here is a program that does all three bitwise operations between the same two patterns. The register is different in each case.

## Program to bitwise OR, AND, and XOR two patterns 
        .text
        .globl  main

main:
        ori     $15, $0,0x0FA5       # put bit pattern register into $15
        ori      $8,$15,0x368F       # OR with second pattern
        andi     $9,$15,0x368F       # AND with second pattern
        xori    $10,$15,0x368F       # XOR with second pattern

## End of file

Running it in SPIM (pushing F10 four times) results in the following:

SPIM display of program results

QUESTION 13:

What is the exclusive-OR of a bit pattern with itself? Try this with a few bit patterns written on a scrap of paper.