Instruction set

Status
Not open for further replies.

Parth86

Member
I want to learn basic Idea that how dose Instruction set Implement
look at following handy example
8 bit Instruction set
first 4 bit for Alu function
last 4 bit for register
A=address register 4bit
I=instruction register 4bit
R1= register 4 bit
R2= register 4 bit
Code:
alu function               AIR1R2
ALU_NOP 4'b0000            XXXX

ALU_ADD 4'b0001             XXXX

ALU_SUB 4'b0010              XXXX

ALU_MUL 4'b0011             XXXX

ALU_DIV 4'b0100              XXXX

ALU_DA 4'b0101               XXXX

ALU_NOT 4'b0110             XXXX

ALU_AND 4'b0111            XXXX

ALU_XOR 4'b1000             XXXX

ALU_OR 4'b1001             XXXX

ALU_RL 4'b1010             XXXX

ALU_RLC 4'b1011            XXXX

ALU_RR 4'b1100              XXXX

ALU_RRC 4'b1101            XXXX

ALU_INC 4'b1110             XXXX

ALU_XCH 4'b111               XXXX


and If ALU_OR 4'b1001
Code:
AIR1R2                        alu out
0000                                     0
0001                                      1
0010                                      1
0011                                      1
0000                                      0
0001                                      1
0010                                      1
0011                                      1
0000                                      0
0001                                      1
0010                                      1
0011                                      1
0000                                      0
0001                                      1
0010                                      1
0011                                      1
If ALU_AND 4'b0111

Code:
AIR1R2                  alu out
0000                                     0
0001                                      0
0010                                      0
0011                                     1
0000                                      0
0001                                      0    
0010                                      0
0011                                     1
0000                                      0
0001                                      0
0010                                      0
0011                                      1
0000                                     0
0001                                      0
0010                                      0
0011                                      1
I made above example just for learning
 
Last edited by a moderator:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…