hello everyone,
i have problem with left shift...can you solve this....
i want to write a simple function which will give output is 32 bit frame:
if input type == 0 - then output will shift left frame id by 18 bits and 31st bit as 0
eg for input configred frame id 0x7ff(111,1111,1111),
FrameID= 0x1ffc0000(0001,1111,1111,1100,0000,0000,0000,0000 )
if input type == 1 then - output will set 31st bit in FrameID
eg for input configred frame id 0x7ff(111,1111,1111),
FrameID= 0x800007ff(1000,0000,0000,0000,0000,0111,1111,1111 )
3 2166
Greetings,
I do not really understand your issue. It would probably help if you included the perl code that you've already tried. Including the assignment creating the variable you're wanting to modify.
- Miller
Hello Miller,
here i am putting code..... -
# Loop for all frames of nwi as TX slot, TX mux(if any), RX slot, RX mux.
-
# This is to fill the remaining fields of the Can_Frame_Details hash.
-
foreach $frm_name (@tx_frm_list, @rx_frm_list, @undec_frm_list) {
-
# Populating the ddCANID key.
-
$SptIm::Can_Frame_Details{$frm_name}{ddCANID} = $SptNetParser::Network_File_Contents_Hash{FrameNIDetails}{$ni_name}{$frm_name}{FrameId};
-
-
# Populating the IdType key.
-
if ($SptNetParser::Network_File_Contents_Hash{NetInterfaceDef}{$ni_name}{Protocol} eq "CAN29") {
-
$SptIm::Can_Frame_Details{$frm_name}{IdType} = 1;
-
-
# Set the Is_Extended_Can_Type to one, if CAN29 exists in NET file
-
$SptDbCfg::Is_Extended_Can_Type = 1;
-
#my problem is here if $SptIm::Can_Frame_Details{$frm_name}{IdType} = 1 #then will shift left frame id by 18 bits #and 31st bit as 0
-
#eg for configred frame id 0x7ff(111,1111,1111), ddCANID= #0x1ffc0000(0001,1111,1111,1100,0000,0000,0000,0000)
-
} else {
-
$SptIm::Can_Frame_Details{$frm_name}{IdType} = 0;
-
#if $SptIm::Can_Frame_Details{$frm_name}{IdType} = 0 then will set 31st bit #in ddCANID
-
#eg for configred frame id 0x7ff(111,1111,1111), ddCANID= #0x800007ff(1000,0000,0000,0000,0000,0111,1111,1111)
-
}
-
-
# Populating the Position key.
-
$frm_ndx++;
-
$SptIm::Can_Frame_Details{$frm_name}{Position} = $frm_ndx;
-
} # End of subroutine create_can_frame_details_oem
-
Thank's & Regard's
Lokee
hello all,
i have solved this problem...
problem was:
#----------------------------------------------------------------------------------#
# /* Algorithm for Calculating the ddCANID */ #
#Problem: ddCANID will be calculate in two way based on protocol type #
# if (protocol equal CAN11) then #
# set IdType = 0; #
# ddCANID will be shift 18 bit left | 31st bit will be set as a 0; #
# /* eg ddCANID = 0x7ff then output will be ddCANID = 0x1ffc0000 #
# if (protocol equal CAN29) then #
# set IdType = 0; #
# ddCANID 31st bit will be set as a 1; #
# /* eg ddCANID = 0x7ff then output will be ddCANID = 0x800007ff #
#----------------------------------------------------------------------------------#
answer:
CALCULATING THE ddCANID
foreach $frm_name (@tx_frm_list, @rx_frm_list, @undec_frm_list)
{
#Populating the ddCANID key.
$SptIm::Can_Frame_Details{$frm_name}{ddCANID} =
$SptNetParser::Network_File_Contents_Hash{FrameNID etails}{$ni_name}
{$frm_name}{FrameId};
# Populating the IdType key.
if ($SptNetParser::Network_File_Contents_Hash{NetInte rfaceDef}{$ni_name}
{Protocol} eq "CAN29")
{
$SptIm::Can_Frame_Details{$frm_name}{IdType} = 1;
$SptIm::Can_Frame_Details{$frm_name}{ddCANID} | = 1 << 31;
# Set the Is_Extended_Can_Type to one, if CAN29 exists in NET file
$SptDbCfg::Is_Extended_Can_Type = 1;
}
if ($SptNetParser::Network_File_Contents_Hash{NetInte rfaceDef}{$ni_name}
{Protocol} eq "CAN11")
{
$SptIm::Can_Frame_Details{$frm_name}{IdType} = 0;
$SptDbCfg::Is_Standard_Can_Type = 0;
$SptIm::Can_Frame_Details{$frm_name}{ddCANID} << = 18 | 0 << 31;
}
}
thank's & regard's
lokee
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Matt |
last post by:
I am new to CSS. My task is to add a table and frequently used link on
the right hand side. Here's the html code and css, I really appreciate
if u can copy and paste and take a look. It looks fine...
|
by: VivN |
last post by:
I want to use an expression as the control source for a text box in a
report (Access 2000).
Whilst I have sucessfully used these simple ones
=TimeToSingle(TotalHours(,))...
|
by: sabarish |
last post by:
Hi to all. find out the biggest among two numbers without using any
conditional statements and any relational operators.
|
by: Peter Bromley |
last post by:
The following code snippet does not seem to work correcly
unsigned __int64 result = 0xFFFFFFFFFFFFFFFF;
result = result << 64;
Debugger.WriteLine(System::String::Format(S"{0:X16}",...
|
by: Saber S |
last post by:
When I press Alt+Shift in a text control, the cursor turns Right-To-Left.
I want it without pressing Alt+Shift, I want to when I click a text control
the cursor automatically turn to Right-To-Left.
|
by: Kenneth Lantrip |
last post by:
Anyone got any ideas as to how this process could be improved for speed?
this is what I have...
Dim j, q As Integer
Dim x(16), y(16) As Byte
x.CopyTo(y, 0) ' shift left circular 24 bits
|
by: chanma |
last post by:
code1:var x=0xf0000000;
alert(x);
output:4026531840
code2:var b=0xf<<28;
alert(b);
output:-268435456
|
by: pelletier.thomas |
last post by:
Hello everybody. I'm trying to code a very little OS.
But I have a problem with the keyboard input:
It show thechar + "~" :s
Can you help me ?
The source is there :...
|
by: Madhur |
last post by:
I am having the following problem of bit shifting.
My program runs on a little endian machine. Consider that if I have
the following data represented in big endian...
0x12345678
the little...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |