Question

In: Computer Science

A) Name and explain the flag registers of 8086?                                  &nbs

A) Name and explain the flag registers of 8086?                                                                                                 

B) Explain the Shift instruction? Name it’s types and explain only one of them?   

C) Explain addressing decoding using 3- to 8- line decoder ?

NOTE: In part C give the reason why we do address decoding and then explain the processes.

Solutions

Expert Solution

A) The flag register is the special purpose register which can be used to toggle it's value from 0 to 1 and 1 to 0 depemding upon the value of the result obtained after arithmetic or logical operations.

In 8086, we have 16-bit flag registers in which 9 are valid flag bits.

The fformat of flag registers are as follows:

Further one can divide these 9 valid flag bits int 2 parts as: status flags(S,Z,AC,P,CY,O) and control flags(D,I,T).

Status flags are used to set the flag after some arithmetic or logical operations.

S - After any operation if the MSB is 1, then it indicates that the number is negative. And this flag is set to 1

Z - If the total register is zero, then only the Z flag is set

AC - When some arithmetic operations generates carry after the lower half and sends it to upper half, the AC will be 1

P - This is even parity flag. When result has even number of 1, it will be set to 1, otherwise 0 for odd number of 1s

CY - This is carry bit. If some operations are generating carry after the operation this flag is set to 1

O - The overflow flag is set to 1 when the result of a signed operation is too large to fit.

And control flags are used to enable or disable the basic operations of the x86 microprocessor.

D - This is directional flag. This is used in string related operations. D = 1, then the string will be accessed from higher memory address to lower memory address, and if D = 0, it will do the reverse.

I - This is interrupt flag. If I = 1, then MPU will recognize the interrupts from peripherals. For I = 0, the interrupts will be ignored

T - This trap flag is used for on-chip debugging. When T = 1, it will work in a single step mode. After each instruction, one internal interrupt is generated. It helps to execute some program instruction by instruction.

B) Shift operations involves moving of the bits in a word to the left or to the right.

The purpose of shift instructions is to shift an operand, bit by bit, to the right or to the left. Direction of shift i.e., either left to right or right to left depemds upon the specific shift instruction.

In shift-left operations, zeros are shifted into low-order vacated positions.

In shift-right operations, bits shifted can be:

- zeros (logical shift right - SRA instruction)

- original value of the sign bit (arithmetic right shift - SRT instruction)

- bits that are shifted out of the low-order position (RTE instruction)

TYPES :

Ther are 3 types of shift instructions:

1. Logical shift instructions -

a. SHL(shift left)

b. SHR (shift right)

2. Arithmetic shift instructions -

a. SAL (shift arithmetic left)

b. SAR (shift arithmetic right)

3. Double precision shift instructions -

a. SHLD (double precision shift left)

b. SHRD (double precision shift right)

Logical Shift instructions:

SHL - It shifts the leftmost bit into the Carry Flag (CF) and overwrites the current value of the Carry Flag.

Each of the remaining bits is shifted leftwise and 0 is shifted into the rightmost bit.

For example,

mov AL, 3
shl AL, 1

This shifts left, AL by 1 place

AL - 00000011 (initially)

Al - 00000110 (after logical left shift)

SHR - It hifts the rightmost bit of operand into the Carry Flag; the current value of the Carry Flag is lost.

Each of the remaining bits is shifted rightwise and 0 is shifted into the leftmost bit of operand.

NOTE - SHR does not preserve the sign of a negative operand. Thus, SHR cannot be used to perform division on negative numbers.

For example,

mov       BL , 00000101
shr     BL , 1

BL - 00000101 (initially)

BL - 00000010 (after logical right shift)

C) An address decoder is a binary decoder that has two or more inputs for addressbits and one or more outputs for device selection signals.

Address decoding is the way a computer decodes the address on the address bus to selsct the memory locations in one or more memory or peripheral devices.

3 to 8 line decoder is a combinational circuit that can be used as both a decoder and a demultiplexer which can be used for for address decoding.

Here input or select lines are connected to the address bus of the system and the output can be connected to CS lines of 8Kx8 EPROM which finally give the output of the decoder to the data bus.


Related Solutions

Assume that the state of the 8086 registers and memory just prior to the execution of...
Assume that the state of the 8086 registers and memory just prior to the execution of each instruction is given as below: (AX) = 0000 H (BX) = 0010 H (CX) = 0105 H (DX) = 1111 H (SI) = 0100 H (DI) = 0200 H (CF)= 0 (DS:100H) = 0F H (DS:200H) = 22 H (DS:220H) = AA H (DS:221H) = 55 H (DS:400H) = AA H (DS:401H) = 55 H Examine the following instructions independently and calculate the...
1- Assume that the state of the 8086 registers and memory just prior to the execution...
1- Assume that the state of the 8086 registers and memory just prior to the execution of each instruction is given as below: (AX) = 0010 H (BX) = 0020 H (CX) = 0030 H (DX) = 0040 H (SI) = 0100 H (DI) = 0200 H (CF) = 1 (DS:100H) = 10 H (DS:101H) = 00 H (DS:120H) = FF H (DS:121H) = FF H (DS:130H) = 08 H (DS:131H) = 00 H (DS:150H) = 02 H (DS:151H) =...
Name:                                         &nbs
Name:                                                                                                          . A manager of a local clothing retail store wants to make a sales and promotion plan for next month. In order to evaluate the effectiveness of the plan, the manager identifies all the costs and other relevant information and conducts Break-even analysis. Here are the identified costs and other related information. Monthly rent fees: $2,500 Wages for the hired employees (Monthly): $6,000 Utility fees (Monthly): $700 Other operation costs (Monthly): $1,000 Purchase price per unit: $78   (The manager...
Patient Name: Jennifer Markus                                     &nbs
Patient Name: Jennifer Markus                                                                                                                                   MR#: 45879 Attending Physician: Katrina McKenzie, M.D. Consulting Physician: Erik Anderson, M.D.                                                                                                            Date: 12/4/11 Subjective: Mrs. Markus is a 33-year-old woman with a PMH [past medical history] significant for depression, asthma, hiatal hernia, and migraine headaches. She presents complaining of waking with a pulsing headache on the left side of her head, with 1 day of prior increased sensitivity to light and to noises, as well as nausea, no emesis. The patient notes that work has been increasingly...
MARKETING ANALYTICS: Case Study                       Name: ____________________          &nbs
MARKETING ANALYTICS: Case Study                       Name: ____________________                                                                                                                                                                                                               Date:     ________________________ Background You have been promoted to Vice President of Marketing for ACME CPG, Inc. ACME sells consumer packaged goods (CPG) to its customers in the United States. ACME competes against other CPG companies, such as Procter & Gamble with brands such as Tide laundry detergent and Ivory soap, as well as Unilever, with brands such as Sun laundry detergent and Dove soap. Customers mostly know ACME CPG for its line of environmentally friendly...
ID   SEX   SMOKE    AGE    PULSE_1  PULSE_2     NAME       ID    SEX   SMOKE&nbs
ID   SEX   SMOKE    AGE    PULSE_1  PULSE_2     NAME       ID    SEX   SMOKE   AGE    PULSE_1     PULSE_2     NAME 1        1         1           31          62             126         ALLAN        21 1          1         38            70 122            ARTHUR 2        2          1         20 78              154         MARY 22 1          0        20            80 139             SAMUEL 3        2          1           28       76 146        BILLIE 23      2 1 33   76 148 AMY 4        2          1          29          81             174        LINDA          24      2         0 25 78 148            ANNIE 5        1         1           21          66            128       MICHAEL      25     2          0 37    76 136            JANE 6        2          1           27         96            265        CATHY          26     2          0 22 80 158            BETH 7        1          0          21           68             120        HARVEY       27     1          0     32   68   116            CHRIS 8        2         1          42           74             149       JENEE            28      1          0     22 70 120            FRANCIS 9        2          1          22          88            160       JEAN               29      1         1      22    68 126             ERNIE 10      1         1          28          90             144       FREEDY         30     1          1        19          70 144           BERTRAM 11      2          0          21          82            140       PAT                 31      2        0        21          86 144            NANCY 12      2          1         22           79            156       MARKIE         32     1         0       26         72 126            BRUCE 13      2         1          43           66           148        SUSAN           33      2        0      32   84 136             MARGE 14      2         0          19           68            142     DENISE           34      2        0        24        72 142             BARBARA 15      1         1          23           92           134       JOHN              35      2       0 28         80 138              JENNY 16      1         0          41          68           112      DAVID 36      1        1 34      62 132              WILLIAM 17      1         0          24          76           158      ROBERT           37      1        0        35            74    164            KYLE 18      2         0          21          86           146      ALLISON          38       1       1       21 90     138           BEN 19      2         1          21           88           156      JILL                 39      1       0       21 66 142           GREG 20      1         1         20            66         132       JACKSON        40       1      0        30 70 132           RICHARD Read the data into R or R-studio...
Your Name, Inc. Balance Sheet 12/31/2017                         Current Assets          &nbs
Your Name, Inc. Balance Sheet 12/31/2017                         Current Assets                                     Cash                                                    $18,000                                     Marketable Securities (Short-term)        2,000                                     Accounts Receivable                           14,000                                         Allowance for Bad Debt                 (2,000)                                     Inventory                                            15,000                                     Prepaid Insurance                                   5,000                                        Total Current Assets                        $52,000                         Property, Plant, and Equipment                                     Land                                                    $30,000                                     Building                                              150,000                                         Accumulated Dep. – Building        (45,000)                                     Equipment                                           100,000                                         Accumulated Dep. - Equipment     (20,000)                                        Total PPE                                         $215,000                                    ...
Draw the figure for memory segments with 8086 microprocessor software model. Explain the logical address structure...
Draw the figure for memory segments with 8086 microprocessor software model. Explain the logical address structure used for each segment (Explain which registers are used in logical address presentation of each segment; segment address : offset address).
1:Explain what is an interrupt and its process.                                  &nbs
1:Explain what is an interrupt and its process.                                                                   2:State any three difference between top-down and bottom-up design strategies 3:What is the difference between Interrupt and polling technique? Which one is preferable and why?
SAMPLE DATA ON OB PHYSICAL ASSESSMENT OB Physical Assessment Tool Name of Client :                             &nbs
SAMPLE DATA ON OB PHYSICAL ASSESSMENT OB Physical Assessment Tool Name of Client :                                                   Date of Assessment: Age : Address: Chief Complaint(If any):____________________________________ I. Obstetrical History:     a)   Menarche: ___________________     b.) Last Menstrual Period (LMP: ________________     c.) Expected Date of Confinement (EDC):_____________________               (based on Naegele’s Rule)     d) Age of Gestation ( Based on LMP):_________________________     e) Trimester of Pregnancy ( based on AOG)           First Trimester    (0-13 weeks): ________ weeks           Second Trimester (14-26 weeks):_______...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT