3. Extract a Field Your program is receiving records from the network, formatted as described in the table below: Bytes 0 Bits 7 6 5 4 3 2 1 0765432107654321 0-3 4-7 8-11 12-15 source-id destination-id 1 size data r flag 2 pri 3 76543210 message-type data-routing The records are provided as byte arrays (or lists) such that the 'destination-id' field, for example, is contained in record [4] and Pick ONE option

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter8: Advanced Method Concepts
Section: Chapter Questions
Problem 7RQ
icon
Related questions
Question
ALL
O
>
3. Extract a Field
Your program is receiving records from the network, formatted as described in the table below:
Bytes
0-3
4-7
8-11
12-15
***
0
Bits 7 6 5 4 3 2
(record[2] & 0xF0) >> 4
(record[6] | OXF) >> 4
(record[2] >> 4) & 0x7
(record[2] & 0x7) << 1
10 765
destination-id
(record[6] & 0x70) >> 4
Clear Selection
source-id
1
2
43210 7 6 5 4 3
size
data
flag
2
10 7 6 5
message-type
The records are provided as byte arrays (or lists) such that the 'destination-id' field, for example, is contained in record [4] and record [5]. How would you go about extracting out the 'flag' field and returning its value?
Pick ONE option
pri
4
3
32 1 0
data-routing
(Alt + A)
Transcribed Image Text:ALL O > 3. Extract a Field Your program is receiving records from the network, formatted as described in the table below: Bytes 0-3 4-7 8-11 12-15 *** 0 Bits 7 6 5 4 3 2 (record[2] & 0xF0) >> 4 (record[6] | OXF) >> 4 (record[2] >> 4) & 0x7 (record[2] & 0x7) << 1 10 765 destination-id (record[6] & 0x70) >> 4 Clear Selection source-id 1 2 43210 7 6 5 4 3 size data flag 2 10 7 6 5 message-type The records are provided as byte arrays (or lists) such that the 'destination-id' field, for example, is contained in record [4] and record [5]. How would you go about extracting out the 'flag' field and returning its value? Pick ONE option pri 4 3 32 1 0 data-routing (Alt + A)
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,